11
What is the idiomatic way to handle exceptions in ring apps. I would like to capture the exception and return a 500 page. How do I do that ?
I am using moustache for the code below, however it doesnt work -
(def my-app (try
(app
(wrap-logger true)
wrap-keyword-params
wrap-params
wrap-file-info
(wrap-file "resources/public/")
[""] (index-route @prev-h nil)
["getContent"] (fetch-url)
["about"] "We are freaking cool man !!"
[&] (-> "Nothing was found" response (status 404) constantly))
(catch Exception e
(app
[&] (-> "This is an error" response (status 500) constantly)))