You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Either directly pass a RecoveryMessage or pass a RecoveryHandler, a function that gives you access to the panic error, manipulate it as needed, maybe even send an alert somewhere and then return a response string that's sent as the server response.
Here's sample use case
// create serveriferr:=barf.Stark(barf.Augment{
Logging: barf.Allow(), // enable request loggingRecovery: barf.Allow(), // enable panic recovery so barf returns a 500 error instead of crashingRecoveryHandler: func (errerror) string {
returnerr.String()
},
RecoveryMessage: "Something went wrong",
}); err!=nil {
barf.Logger().Error(err.Error())
os.Exit(1)
}
The text was updated successfully, but these errors were encountered:
Either directly pass a
RecoveryMessage
or pass aRecoveryHandler
, a function that gives you access to the panic error, manipulate it as needed, maybe even send an alert somewhere and then return a response string that's sent as the server response.Here's sample use case
The text was updated successfully, but these errors were encountered: