CustomRecovery returns a middleware that recovers from any panics and calls the provided handle func to handle it.
(handle RecoveryFunc)
| 38 | |
| 39 | // CustomRecovery returns a middleware that recovers from any panics and calls the provided handle func to handle it. |
| 40 | func CustomRecovery(handle RecoveryFunc) HandlerFunc { |
| 41 | return RecoveryWithWriter(DefaultErrorWriter, handle) |
| 42 | } |
| 43 | |
| 44 | // RecoveryWithWriter returns a middleware for a given writer that recovers from any panics and writes a 500 if there was one. |
| 45 | func RecoveryWithWriter(out io.Writer, recovery ...RecoveryFunc) HandlerFunc { |