From 848fa41ca016fa3a3d385af710c4219c1cb477a4 Mon Sep 17 00:00:00 2001 From: Eason Lin Date: Tue, 5 Sep 2017 09:17:53 +0800 Subject: [PATCH] doc(recovery): add RecoveryWithWriter doc (#1097) --- recovery.go | 1 + 1 file changed, 1 insertion(+) diff --git a/recovery.go b/recovery.go index dfea8c2..89b39fe 100644 --- a/recovery.go +++ b/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 {