[99s-extend] cowboy and handling exceptions

Stefan Strigler stefan.strigler at gmail.com
Wed Jan 14 17:45:41 CET 2015


Hey there,

maybe I'm missing the obvious. What I want to do is add some generic
handler for exception handling. Say we have a set of resources some of
which delegating stuff to external, other services. These calls might
result in a

throw({error, timeout})

for instance. How would I add/modify cowboy's middleware (right place?) to
handle those (known) exception and return a custom error (like 504 -
Gateway Timeout).

Thanks for any hints,

Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20150114/3267f73e/attachment.html>


More information about the Extend mailing list