Permalink
Browse files

catch errors creating new query procs, BugzID 11197

  • Loading branch information...
1 parent 9b8ec05 commit 98a03a079ab24f2c7bd9e0d6d7fac5fa62bfd4eb @kocolosk kocolosk committed Nov 9, 2010
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/couchdb/couch_proc_manager.erl
@@ -34,7 +34,10 @@ handle_call({get_proc, #doc{body={Props}}=DDoc, DDocKey}, {Client, _}, State) ->
ets:insert(State#state.tab, Proc),
{reply, {ok, Proc, get_query_server_config()}, State}
catch {unknown_query_language, _} ->
- {reply, {unknown_query_language, Lang}, State}
+ {reply, {unknown_query_language, Lang}, State};
+ error:Reason ->
+ ?LOG_ERROR("~p ~p ~p", [?MODULE, Reason, erlang:get_stacktrace()]),
+ {reply, {error, Reason}, State}
end;
handle_call({get_proc, Lang}, {Client, _}, State) ->
@@ -44,7 +47,10 @@ handle_call({get_proc, Lang}, {Client, _}, State) ->
ets:insert(State#state.tab, Proc),
{reply, {ok, Proc, get_query_server_config()}, State}
catch {unknown_query_language, _} ->
- {reply, {unknown_query_language, Lang}, State}
+ {reply, {unknown_query_language, Lang}, State};
+ error:Reason ->
+ ?LOG_ERROR("~p ~p ~p", [?MODULE, Reason, erlang:get_stacktrace()]),
+ {reply, {error, Reason}, State}
end;
handle_call({ret_proc, #proc{client=Ref, pid=Pid} = Proc}, _From, State) ->

0 comments on commit 98a03a0

Please sign in to comment.