[erlang-questions] Fail politely, fail noisily

Erik Søe Sørensen <>
Sun Sep 2 09:25:33 CEST 2012


We used a similar, though more lightweight and probably less
thought-through version of this: use make_ref() and show the reference both
to the user and in the logs.
(Compared to Jesper's approach, this has potential uniqueness issues, and
gives less control over display form, unless you really work for it. On the
other hand, Jesper's function technically has a uniqueness problem wrt.
multiple nodes - so it'd make sense to add a node() component there.)
Den 30/08/2012 16.53 skrev "Jesper Louis Andersen" <
>:

>
> On Aug 29, 2012, at 9:47 AM, Thomas Elsgaard <>
> wrote:
>
> > Hi Joe
> >
> > There is also PHK's concept of "guru meditation" in the varnish http
> accelerator..
> >
> > http://www.version2.dk/blog/guru-meditation-9738
> >
> > Basically the idea is: the user cannot do anything about the error, so
> let it fail, but provide the transaction Id (xid) so the admin can can
> troubleshoot...
>
> I did this in erlang. It is very easy. When the web server crashes on the
> message, you grab Trace = erlang:get_stacktrace(), and Now = erlang:now().
> Then you generate a unique token: crypto:sha(term_to_binary({Trace, Now}))
> and you put that token to the user as well as in the crash log of the
> server.
>
> Now any bug reported with a proper token just requires a grep on the logs
> to find the exact error the user had.
>
> I think it took me 1-2 hours to write and test.
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120902/404c7bd1/attachment.html>


More information about the erlang-questions mailing list