MCPcopy Create free account
hub / github.com/gotify/server / TestDefaultErrorInternal

Function TestDefaultErrorInternal

error/handler_test.go:16–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestDefaultErrorInternal(t *testing.T) {
17 mode.Set(mode.TestDev)
18 rec := httptest.NewRecorder()
19 ctx, _ := gin.CreateTestContext(rec)
20 ctx.AbortWithError(500, errors.New("something went wrong"))
21
22 Handler()(ctx)
23
24 assertJSONResponse(t, rec, 500, `{"errorCode":500, "errorDescription":"something went wrong", "error":"Internal Server Error"}`)
25}
26
27func TestBindingErrorDefault(t *testing.T) {
28 mode.Set(mode.TestDev)

Callers

nothing calls this directly

Calls 3

SetFunction · 0.92
HandlerFunction · 0.85
assertJSONResponseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…