Skip to content
Browse files

core: add backtrace to error reason in case of depcache memo errors.

also return error reason as result of the z_depcache:memo/5 function.
  • Loading branch information...
1 parent 9ee9c9a commit 6bebb35976a485229fd6726f66513c546e4266db @kaos kaos committed Nov 12, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/support/z_depcache.erl
View
4 src/support/z_depcache.erl
@@ -96,7 +96,7 @@ memo(F, Key, MaxAge, Dep, #context{} = Context) ->
end,
Value
catch
- _: R -> memo_send_errors(Key, R, Context)
+ _: R -> memo_send_errors(Key, {R, erlang:get_stacktrace()}, Context)
end
end.
@@ -117,7 +117,7 @@ memo(F, Key, MaxAge, Dep, #context{} = Context) ->
memo_send_errors(Key, Reason, Context) ->
Pids = get_waiting_pids(Key, Context),
[ catch gen_server:reply(Pid, {error, Reason}) || Pid <- Pids ],
- error.
+ {error, Reason}.
%% @spec set(Key, Data, Context) -> void()

2 comments on commit 6bebb35

@arjan
Zotonic member
arjan commented on 6bebb35 Nov 13, 2012

Yeah!
I was missing this for a long time.

@kaos
Zotonic member
kaos commented on 6bebb35 Nov 13, 2012

:)

Please sign in to comment.
Something went wrong with that request. Please try again.