Added Status method

This commit is contained in:
Eduard Urbach 2024-03-13 16:57:36 +01:00
parent ee0acd473b
commit 1e8a846457
Signed by: eduard
GPG key ID: 49226B848C78F6C8
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 {