|
|
@@ -13,6 +13,7 @@ var (
|
|
|
|
CatForeign = ErrorCategory{"Foreign"} // A foreign error that some component threw (e.g. an unknown mongodb error), happens if we call Wrap(..) on an non-bmerror value
|
|
|
|
CatForeign = ErrorCategory{"Foreign"} // A foreign error that some component threw (e.g. an unknown mongodb error), happens if we call Wrap(..) on an non-bmerror value
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//goland:noinspection GoUnusedGlobalVariable
|
|
|
|
var AllCategories = []ErrorCategory{CatWrap, CatSystem, CatUser, CatForeign}
|
|
|
|
var AllCategories = []ErrorCategory{CatWrap, CatSystem, CatUser, CatForeign}
|
|
|
|
|
|
|
|
|
|
|
|
type ErrorSeverity struct{ Severity string }
|
|
|
|
type ErrorSeverity struct{ Severity string }
|
|
|
@@ -26,6 +27,7 @@ var (
|
|
|
|
SevFatal = ErrorSeverity{"Fatal"}
|
|
|
|
SevFatal = ErrorSeverity{"Fatal"}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//goland:noinspection GoUnusedGlobalVariable
|
|
|
|
var AllSeverities = []ErrorSeverity{SevTrace, SevDebug, SevInfo, SevWarn, SevErr, SevFatal}
|
|
|
|
var AllSeverities = []ErrorSeverity{SevTrace, SevDebug, SevInfo, SevWarn, SevErr, SevFatal}
|
|
|
|
|
|
|
|
|
|
|
|
type ErrorType struct {
|
|
|
|
type ErrorType struct {
|
|
|
@@ -33,6 +35,7 @@ type ErrorType struct {
|
|
|
|
DefaultStatusCode *int
|
|
|
|
DefaultStatusCode *int
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//goland:noinspection GoUnusedGlobalVariable
|
|
|
|
var (
|
|
|
|
var (
|
|
|
|
TypeInternal = ErrorType{"INTERNAL_ERROR", langext.Ptr(500)}
|
|
|
|
TypeInternal = ErrorType{"INTERNAL_ERROR", langext.Ptr(500)}
|
|
|
|
TypePanic = ErrorType{"PANIC", langext.Ptr(500)}
|
|
|
|
TypePanic = ErrorType{"PANIC", langext.Ptr(500)}
|
|
|
@@ -51,6 +54,10 @@ var (
|
|
|
|
// other values come from pkgconfig
|
|
|
|
// other values come from pkgconfig
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func NewType(key string, defStatusCode *int) ErrorType {
|
|
|
|
|
|
|
|
return ErrorType{key, defStatusCode}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type LogPrintLevel string
|
|
|
|
type LogPrintLevel string
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
const (
|
|
|
|