Closed silasdavis closed 5 years ago
Could you tell me how you would implement this function in your case?
Something like:
rmq.Panicf = func(format string, v... interface{}) {
rmqErr := fmt.Errorf(format, v...)
logger.Info("err", rmqErr , "component", "workers", "code", RMQPanicCode)
// restart my worker queues but leave the rest of my app alone
err := workers.Restart()
if err != nil {
panic(fmt.Errorf("could not restart workers after rmq panicked with %v: %v", rmqErr, err))
}
}
Can we have some merge please sir?
This keeps the current panic behaviour as the default but allows library users to override it if preferred.
fixes #61 (mostly)