v0.0.490 documentation and extra-params in exerr
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 4m2s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 4m2s
This commit is contained in:
14
exerr/gin.go
14
exerr/gin.go
@@ -90,6 +90,20 @@ func (ee *ExErr) ToAPIJson(applyExtendListener bool, includeWrappedErrors bool,
|
||||
apiOutput["__data"] = ee.toJson(0, applyExtendListener, includeMetaFields)
|
||||
}
|
||||
|
||||
for exkey, exval := range ee.Extra {
|
||||
|
||||
// ensure we do not override existing values
|
||||
for {
|
||||
if _, ok := apiOutput[exkey]; ok {
|
||||
exkey = "_" + exkey
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
apiOutput[exkey] = exval
|
||||
}
|
||||
|
||||
if applyExtendListener {
|
||||
pkgconfig.ExtendGinOutput(ee, apiOutput)
|
||||
}
|
||||
|
Reference in New Issue
Block a user