在环形应用程序中处理异常的惯用方法是什么。我想捕获异常并返回 500 页。我怎么做 ?
我在下面的代码中使用了 mustache,但是它不起作用 -
(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)))