Repository: couchdb-chttpd
Updated Branches:
  refs/heads/master 59bb3f239 -> b468c7de3


Do not pass unknown_error atom to plugin

There is no reason to pass {unknown_error, Error} to plugin and force it to
implement a match on that tuple. We should pass the Error itself and let
the plugin decide what to do with it.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/088bbe55
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/088bbe55
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/088bbe55

Branch: refs/heads/master
Commit: 088bbe55e94f6cb23d91b4099dbca783d2cafa56
Parents: 59bb3f2
Author: ILYA Khlopotov <iil...@ca.ibm.com>
Authored: Thu Jun 30 10:03:12 2016 -0700
Committer: ILYA Khlopotov <iil...@ca.ibm.com>
Committed: Thu Jun 30 10:15:38 2016 -0700

----------------------------------------------------------------------
 src/chttpd.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/088bbe55/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index 8a42e62..4672084 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -884,7 +884,7 @@ error_info({Error, nil, _Stack}) ->
 error_info({Error, Reason, _Stack}) ->
     {500, couch_util:to_binary(Error), couch_util:to_binary(Reason)};
 error_info(Error) ->
-    maybe_handle_error({<<"unknown_error">>, Error}).
+    maybe_handle_error(Error).
 
 maybe_handle_error(Error) ->
     case chttpd_plugin:handle_error(Error) of
@@ -893,7 +893,7 @@ maybe_handle_error(Error) ->
         {Err, Reason} ->
             {500, couch_util:to_binary(Err), couch_util:to_binary(Reason)};
         Error ->
-            {500, couch_util:to_binary(Error), null}
+            {500, <<"unknown_error">>, couch_util:to_binary(Error)}
     end.
 
 

Reply via email to