|
|
@@ -16,23 +16,25 @@ type ErrorPackageConfig struct {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ErrorPackageConfigInit struct {
|
|
|
|
type ErrorPackageConfigInit struct {
|
|
|
|
ZeroLogErrTraces bool
|
|
|
|
ZeroLogErrTraces bool
|
|
|
|
ZeroLogAllTraces bool
|
|
|
|
ZeroLogAllTraces bool
|
|
|
|
RecursiveErrors bool
|
|
|
|
RecursiveErrors bool
|
|
|
|
ExtendedGinOutput bool
|
|
|
|
ExtendedGinOutput bool
|
|
|
|
ExtendGinOutput func(err *ExErr, json map[string]any)
|
|
|
|
IncludeMetaInGinOutput bool
|
|
|
|
ExtendGinDataOutput func(err *ExErr, depth int, json map[string]any)
|
|
|
|
ExtendGinOutput func(err *ExErr, json map[string]any)
|
|
|
|
|
|
|
|
ExtendGinDataOutput func(err *ExErr, depth int, json map[string]any)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var initialized = false
|
|
|
|
var initialized = false
|
|
|
|
|
|
|
|
|
|
|
|
var pkgconfig = ErrorPackageConfig{
|
|
|
|
var pkgconfig = ErrorPackageConfig{
|
|
|
|
ZeroLogErrTraces: true,
|
|
|
|
ZeroLogErrTraces: true,
|
|
|
|
ZeroLogAllTraces: false,
|
|
|
|
ZeroLogAllTraces: false,
|
|
|
|
RecursiveErrors: true,
|
|
|
|
RecursiveErrors: true,
|
|
|
|
ExtendedGinOutput: false,
|
|
|
|
ExtendedGinOutput: false,
|
|
|
|
ExtendGinOutput: func(err *ExErr, json map[string]any) {},
|
|
|
|
IncludeMetaInGinOutput: true,
|
|
|
|
ExtendGinDataOutput: func(err *ExErr, depth int, json map[string]any) {},
|
|
|
|
ExtendGinOutput: func(err *ExErr, json map[string]any) {},
|
|
|
|
|
|
|
|
ExtendGinDataOutput: func(err *ExErr, depth int, json map[string]any) {},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Init initializes the exerr packages
|
|
|
|
// Init initializes the exerr packages
|
|
|
@@ -54,12 +56,13 @@ func Init(cfg ErrorPackageConfigInit) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pkgconfig = ErrorPackageConfig{
|
|
|
|
pkgconfig = ErrorPackageConfig{
|
|
|
|
ZeroLogErrTraces: cfg.ZeroLogErrTraces,
|
|
|
|
ZeroLogErrTraces: cfg.ZeroLogErrTraces,
|
|
|
|
ZeroLogAllTraces: cfg.ZeroLogAllTraces,
|
|
|
|
ZeroLogAllTraces: cfg.ZeroLogAllTraces,
|
|
|
|
RecursiveErrors: cfg.RecursiveErrors,
|
|
|
|
RecursiveErrors: cfg.RecursiveErrors,
|
|
|
|
ExtendedGinOutput: cfg.ExtendedGinOutput,
|
|
|
|
ExtendedGinOutput: cfg.ExtendedGinOutput,
|
|
|
|
ExtendGinOutput: ego,
|
|
|
|
IncludeMetaInGinOutput: cfg.IncludeMetaInGinOutput,
|
|
|
|
ExtendGinDataOutput: egdo,
|
|
|
|
ExtendGinOutput: ego,
|
|
|
|
|
|
|
|
ExtendGinDataOutput: egdo,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
initialized = true
|
|
|
|
initialized = true
|
|
|
|