Added Status method

This commit is contained in:
2024-03-13 16:57:36 +01:00
parent 4d822dbc30
commit 1bcf4794f5
5 changed files with 17 additions and 13 deletions

View File

@ -27,11 +27,11 @@ func TestRouter(t *testing.T) {
})
s.Get("/error", func(ctx server.Context) error {
return ctx.Error(http.StatusUnauthorized, "Not logged in")
return ctx.Status(http.StatusUnauthorized).Error("Not logged in")
})
s.Get("/error2", func(ctx server.Context) error {
return ctx.Error(http.StatusUnauthorized, "Not logged in", errors.New("Missing auth token"))
return ctx.Status(http.StatusUnauthorized).Error("Not logged in", errors.New("Missing auth token"))
})
s.Get("/reader", func(ctx server.Context) error {