Fork me on GitHub
#reitit
<
2024-03-06
>
itaied11:03:23

hey all, I'm using reitit in my clj app (using ring) how can I send the full stacktrace in the response and log it when an exception is thrown? currently only the name of the exception is thrown and it's missing a lot of debugging valuable data

def router
  (ring/ring-handler
   (ring/router
    ["/api" ...]
    {:data {:middleware [exception/exception-middleware]}})
   (ring/create-default-handler))

Ben Sless12:03:56

Look at the exception middleware and its default case, that's just what you need

itaied12:03:19

I have added the default middleware

{:data {:middleware [exception/exception-middleware]}})
but it return just a small portion of the exception (also documented like this)