Selaa lähdekoodia

doc(recovery): add RecoveryWithWriter doc (#1097)

Eason Lin 8 vuotta sitten
vanhempi
commit
848fa41ca0
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      recovery.go

+ 1 - 0
recovery.go

@@ -26,6 +26,7 @@ func Recovery() HandlerFunc {
 	return RecoveryWithWriter(DefaultErrorWriter)
 }
 
+// RecoveryWithWriter returns a middleware for a given writer that recovers from any panics and writes a 500 if there was one.
 func RecoveryWithWriter(out io.Writer) HandlerFunc {
 	var logger *log.Logger
 	if out != nil {