Fix bug in internal error

This commit is contained in:
Jae Kwon 2015-04-01 21:16:02 -07:00
parent 13b6508ecd
commit 543fc73ab6
1 changed files with 2 additions and 2 deletions

View File

@ -74,9 +74,9 @@ func RecoverAndLogHandler(handler http.Handler) http.Handler {
WriteRPCResponse(rww, res)
} else {
// For the rest,
rww.WriteHeader(http.StatusInternalServerError)
rww.Write([]byte("Internal Server Error"))
log.Error("Panic in HTTP handler", "error", e, "stack", string(debug.Stack()))
rww.WriteHeader(http.StatusInternalServerError)
WriteRPCResponse(rww, NewRPCResponse(nil, Fmt("Internal Server Error: %v", e)))
}
}