feat(smalltrip,exceptions): Data field for additional contextual data
This commit is contained in:
@@ -7,11 +7,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Exception struct {
|
type Exception struct {
|
||||||
Status int `json:"status"` // HTTP Status Code
|
Status int `json:"status"` // HTTP Status Code
|
||||||
Code string `json:"code"` // Application error code
|
Code string `json:"code"` // Application error code
|
||||||
Message string `json:"message"` // User friendly message
|
Message string `json:"message"` // User friendly message
|
||||||
Err error `json:"error,omitempty"` // Go error
|
Err error `json:"error,omitempty"` // Go error
|
||||||
Severity Severity `json:"severity"` // Exception level
|
Data map[string]any `json:"data,omitempty"` // Additional contextual data
|
||||||
|
Severity Severity `json:"severity"` // Exception level
|
||||||
|
|
||||||
// Handler to be used. This is normally provided by a middleware via the
|
// Handler to be used. This is normally provided by a middleware via the
|
||||||
// request context. Setting this field overrides any provided by the middleware
|
// request context. Setting this field overrides any provided by the middleware
|
||||||
|
|||||||
Reference in New Issue
Block a user