v0.0.195
This commit is contained in:
parent
bbd7a7bc2c
commit
a73d7d1654
@ -19,8 +19,8 @@ type ErrorPackageConfigInit struct {
|
||||
ZeroLogAllTraces bool
|
||||
RecursiveErrors bool
|
||||
ExtendedGinOutput bool
|
||||
ExtendGinOutput *func(err *ExErr, json map[string]any)
|
||||
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
|
||||
@ -42,13 +42,23 @@ func Init(cfg ErrorPackageConfigInit) {
|
||||
panic("Cannot re-init error package")
|
||||
}
|
||||
|
||||
ego := func(err *ExErr, json map[string]any) {}
|
||||
egdo := func(err *ExErr, depth int, json map[string]any) {}
|
||||
|
||||
if cfg.ExtendGinOutput != nil {
|
||||
ego = cfg.ExtendGinOutput
|
||||
}
|
||||
if cfg.ExtendGinDataOutput != nil {
|
||||
egdo = cfg.ExtendGinDataOutput
|
||||
}
|
||||
|
||||
pkgconfig = ErrorPackageConfig{
|
||||
ZeroLogErrTraces: cfg.ZeroLogErrTraces,
|
||||
ZeroLogAllTraces: cfg.ZeroLogAllTraces,
|
||||
RecursiveErrors: cfg.RecursiveErrors,
|
||||
ExtendedGinOutput: cfg.ExtendedGinOutput,
|
||||
ExtendGinOutput: langext.Coalesce(cfg.ExtendGinOutput, func(err *ExErr, json map[string]any) {}),
|
||||
ExtendGinDataOutput: langext.Coalesce(cfg.ExtendGinDataOutput, func(err *ExErr, depth int, json map[string]any) {}),
|
||||
ExtendGinOutput: ego,
|
||||
ExtendGinDataOutput: egdo,
|
||||
}
|
||||
|
||||
initialized = true
|
||||
|
@ -1,5 +1,5 @@
|
||||
package goext
|
||||
|
||||
const GoextVersion = "0.0.194"
|
||||
const GoextVersion = "0.0.195"
|
||||
|
||||
const GoextVersionTimestamp = "2023-07-24T11:40:47+0200"
|
||||
const GoextVersionTimestamp = "2023-07-24T11:42:52+0200"
|
||||
|
Loading…
Reference in New Issue
Block a user