Permalink
Browse files

Merge branch 'riak-1.0.x'

  • Loading branch information...
2 parents 4537c03 + 38a78fd commit 8d8cb3d1938c4af02511633000d28e6ea3021bf0 @Vagabond Vagabond committed Dec 19, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/webmachine_error_handler.erl
@@ -38,7 +38,15 @@ render_error_body(404, Req, _Reason) ->
render_error_body(500, Req, Reason) ->
{ok, ReqState} = Req:add_response_header("Content-Type", "text/html"),
{Path,_} = Req:path(),
- error_logger:error_msg("webmachine error: path=~p~n~p~n", [Path, Reason]),
+ case Reason of
+ {error, {exit, normal, _Stack}} ->
+ %% webmachine_request did an exit(normal), so suppress this
+ %% message. This usually happens when a chunked upload is
+ %% interrupted by network failure.
+ ok;
+ _ ->
+ error_logger:error_msg("webmachine error: path=~p~n~p~n", [Path, Reason])
+ end,
STString = io_lib:format("~p", [Reason]),
ErrorStart = "<html><head><title>500 Internal Server Error</title></head><body><h1>Internal Server Error</h1>The server encountered an error while processing this request:<br><pre>",
ErrorEnd = "</pre><P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></body></html>",

0 comments on commit 8d8cb3d

Please sign in to comment.