Repository: couchdb-couch Updated Branches: refs/heads/master d4ae1a44a -> fc1899bed
Fix error handling in couch_util:with_proc Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/fc1899be Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/fc1899be Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/fc1899be Branch: refs/heads/master Commit: fc1899bede1ad0554d8cdda09963a4dafa75fd54 Parents: d4ae1a4 Author: Russell Branca <[email protected]> Authored: Tue Apr 21 18:10:44 2015 +0000 Committer: Russell Branca <[email protected]> Committed: Tue Apr 21 18:22:17 2015 +0000 ---------------------------------------------------------------------- src/couch_util.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/fc1899be/src/couch_util.erl ---------------------------------------------------------------------- diff --git a/src/couch_util.erl b/src/couch_util.erl index 69fd53f..742ab70 100644 --- a/src/couch_util.erl +++ b/src/couch_util.erl @@ -576,10 +576,10 @@ ensure_loaded(_Module) -> false. %% a function that does a receive as it would hijack incoming messages. with_proc(M, F, A, Timeout) -> {Pid, Ref} = spawn_monitor(fun() -> - exit(erlang:apply(M, F, A)) + exit({reply, erlang:apply(M, F, A)}) end), receive - {'DOWN', Ref, process, Pid, Resp} -> + {'DOWN', Ref, process, Pid, {reply, Resp}} -> {ok, Resp}; {'DOWN', Ref, process, Pid, Error} -> {error, Error}
