Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save archaelus/2951 to your computer and use it in GitHub Desktop.
Save archaelus/2951 to your computer and use it in GitHub Desktop.
loop(Request) ->
try
process(Request)
catch
Class:Exception ->
Req:respond({500, [{"Content-Type", "text/plain"}],
io_lib:format("Couldn't process request ~p~n"
"Exception: ~p:~p~n"
"StackTrace:~p~n", [Request:dump(), Class, Exception,
erlang:get_stacktrace()])})
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment