mirror of
https://github.com/restic/rest-server.git
synced 2025-12-06 17:15:45 -08:00
Fix tests, add PanicOnError option
- Helper method for internal server errors with consistent logging. - Add PanicOnError option to panic on internal server errors. This makes it easier to traces where the condition was hit in testing.
This commit is contained in:
committed by
Alexander Neumann
parent
d4cd47e503
commit
63c8797ba3
@@ -211,9 +211,15 @@ func TestResticHandler(t *testing.T) {
|
||||
|
||||
// set append-only mode and configure path
|
||||
mux, err := NewHandler(&Server{
|
||||
AppendOnly: true,
|
||||
Path: tempdir,
|
||||
AppendOnly: true,
|
||||
Path: tempdir,
|
||||
NoAuth: true,
|
||||
Debug: true,
|
||||
PanicOnError: true,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("error from NewHandler: %v", err)
|
||||
}
|
||||
|
||||
// create the repo
|
||||
checkRequest(t, mux.ServeHTTP,
|
||||
|
||||
Reference in New Issue
Block a user