MCPcopy
hub / github.com/gin-gonic/gin / CustomRecovery

Function CustomRecovery

recovery.go:40–42  ·  view source on GitHub ↗

CustomRecovery returns a middleware that recovers from any panics and calls the provided handle func to handle it.

(handle RecoveryFunc)

Source from the content-addressed store, hash-verified

38
39// CustomRecovery returns a middleware that recovers from any panics and calls the provided handle func to handle it.
40func 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.
45func RecoveryWithWriter(out io.Writer, recovery ...RecoveryFunc) HandlerFunc {

Callers 1

TestCustomRecoveryFunction · 0.85

Calls 1

RecoveryWithWriterFunction · 0.85

Tested by 1

TestCustomRecoveryFunction · 0.68