This commit is contained in:
2023-07-24 11:11:15 +02:00
parent 2e6ca48d22
commit 16c66ee28c
12 changed files with 100 additions and 163 deletions

View File

@@ -2,7 +2,6 @@ package exerr
import (
"gogs.mikescher.com/BlackForestBytes/goext/langext"
"net/http"
)
type ErrorCategory struct{ Category string }
@@ -35,9 +34,20 @@ type ErrorType struct {
}
var (
TypeInternal = ErrorType{"Internal", langext.Ptr(http.StatusInternalServerError)}
TypePanic = ErrorType{"Panic", langext.Ptr(http.StatusInternalServerError)}
TypeWrap = ErrorType{"Wrap", nil}
TypeInternal = ErrorType{"INTERNAL_ERROR", langext.Ptr(500)}
TypePanic = ErrorType{"PANIC", langext.Ptr(500)}
TypeNotImplemented = ErrorType{"NOT_IMPLEMENTED", langext.Ptr(500)}
TypeWrap = ErrorType{"Wrap", nil}
TypeBindFailURI = ErrorType{"BINDFAIL_URI", langext.Ptr(400)}
TypeBindFailQuery = ErrorType{"BINDFAIL_QUERY", langext.Ptr(400)}
TypeBindFailJSON = ErrorType{"BINDFAIL_JSON", langext.Ptr(400)}
TypeBindFailFormData = ErrorType{"BINDFAIL_FORMDATA", langext.Ptr(400)}
TypeUnauthorized = ErrorType{"UNAUTHORIZED", langext.Ptr(401)}
TypeAuthFailed = ErrorType{"AUTH_FAILED", langext.Ptr(401)}
// other values come from pkgconfig
)