updated json response to match spec by @davebryson

This commit is contained in:
Dave Bryson
2017-05-26 14:46:33 +02:00
committed by Ethan Buchman
parent e0017c8a97
commit 60a1f49a5c
6 changed files with 97 additions and 33 deletions

View File

@ -99,7 +99,7 @@ func RecoverAndLogHandler(handler http.Handler, logger log.Logger) http.Handler
// For the rest,
logger.Error("Panic in RPC HTTP handler", "err", e, "stack", string(debug.Stack()))
rww.WriteHeader(http.StatusInternalServerError)
WriteRPCResponseHTTP(rww, types.NewRPCResponse("", nil, fmt.Sprintf("Internal Server Error: %v", e)))
WriteRPCResponseHTTP(rww, types.RPCInternalError(""))
}
}