summaryrefslogtreecommitdiffstats
path: root/common/herrors
diff options
context:
space:
mode:
Diffstat (limited to 'common/herrors')
-rw-r--r--common/herrors/errors.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/herrors/errors.go b/common/herrors/errors.go
index 1a6107050..e484ecb80 100644
--- a/common/herrors/errors.go
+++ b/common/herrors/errors.go
@@ -50,9 +50,10 @@ func FprintStackTrace(w io.Writer, err error) {
// Recover is a helper function that can be used to capture panics.
// Put this at the top of a method/function that crashes in a template:
// defer herrors.Recover()
-func Recover() {
+func Recover(args ...interface{}) {
if r := recover(); r != nil {
- fmt.Println("stacktrace from panic: \n" + string(debug.Stack()))
+ args = append(args, "stacktrace from panic: \n"+string(debug.Stack()), "\n")
+ fmt.Println(args...)
}
}