@@ -6,12 +6,6 @@ import (
66 "github.com/gofiber/fiber/v2"
77)
88
9- var (
10- ErrAuthentication = errors .New ("token authentication failed" )
11- ErrInvalidDateTime = errors .New ("invalid date time format (RFC 3339 needed)" )
12- ErrKeyLen = errors .New ("PASETO_KEY must be 32 bytes long once base64-decoded" )
13- )
14-
159func InternalServerError (title string ) ProblemJSONError {
1610 return Error (fiber .StatusInternalServerError , title , fiber .ErrInternalServerError .Message )
1711}
@@ -20,14 +14,6 @@ func Error(status int, title string, detail string) ProblemJSONError {
2014 return ProblemJSONError {Title : title , Detail : detail , Status : status }
2115}
2216
23- func ErrorWithValidationErrors (
24- status int , title string , validationErrors []ValidationError ,
25- ) ProblemJSONError {
26- detail := GenerateErrorDetails (validationErrors )
27-
28- return ProblemJSONError {Title : title , Detail : detail , Status : status , ValidationErrors : validationErrors }
29- }
30-
3117func CustomErrorHandler (ctx * fiber.Ctx , err error ) error {
3218 var problemJSON * ProblemJSONError
3319
@@ -37,10 +23,6 @@ func CustomErrorHandler(ctx *fiber.Ctx, err error) error {
3723 problemJSON = & ProblemJSONError {Status : e .Code , Title : e .Message }
3824 }
3925
40- if errors .Is (err , ErrAuthentication ) {
41- problemJSON = & ProblemJSONError {Status : fiber .StatusUnauthorized , Title : err .Error ()}
42- }
43-
4426 if problemJSON == nil {
4527 //nolint:errorlint
4628 switch e := err .(type ) {
0 commit comments