Permalink
Browse files

making show_errors more robust

  • Loading branch information...
1 parent ea791a1 commit 0cb0a90f47521de454bf24e9f79e9a7400aa6bba @paulbellamy committed Sep 4, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 show_errors.go
View
2 show_errors.go
@@ -24,7 +24,7 @@ func ShowErrors(templateString string) Middleware {
defer func() {
if err := recover(); err != nil {
buffer := bytes.NewBufferString("")
- errorTemplate.Execute(buffer, struct{ Error string }{err.(string)})
+ errorTemplate.Execute(buffer, struct{ Error string }{fmt.Sprintf("%s", err)})
status = 500
headers = Headers{}
body = Body(buffer.String())

0 comments on commit 0cb0a90

Please sign in to comment.