v0.0.188 exerr MVP
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
package exerr
|
||||
|
||||
import (
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type ErrorCategory struct{ Category string }
|
||||
|
||||
var (
|
||||
@@ -24,9 +29,22 @@ var (
|
||||
|
||||
var AllSeverities = []ErrorSeverity{SevTrace, SevDebug, SevInfo, SevWarn, SevErr, SevFatal}
|
||||
|
||||
type ErrorType struct{ Key string }
|
||||
type ErrorType struct {
|
||||
Key string
|
||||
DefaultStatusCode *int
|
||||
}
|
||||
|
||||
var (
|
||||
TypeInternal = ErrorType{"Internal"}
|
||||
TypeInternal = ErrorType{"Internal", langext.Ptr(http.StatusInternalServerError)}
|
||||
TypePanic = ErrorType{"Panic", langext.Ptr(http.StatusInternalServerError)}
|
||||
TypeWrap = ErrorType{"Wrap", nil}
|
||||
// other values come from pkgconfig
|
||||
)
|
||||
|
||||
type LogPrintLevel string
|
||||
|
||||
const (
|
||||
LogPrintFull LogPrintLevel = "Full"
|
||||
LogPrintOverview LogPrintLevel = "Overview"
|
||||
LogPrintShort LogPrintLevel = "Short"
|
||||
)
|
||||
|
Reference in New Issue
Block a user