Fork me on GitHub
#graphql
<
2019-08-15
>
erwinrooijakkers08:08:40

Is there a way to add an exception handler to Lacinia Pedestal?

erwinrooijakkers08:08:30

Want to catch exception and log to Sentry. E.g.,

(def sentry-error-handler
  (fn [^Exception e _]
    (log/info e (.getMessage e))
    (sentry-capture e)
    (http-response/internal-server-error
     {:error "Oops! We have been notified."})))

mynomoto11:08:15

I did configure sentry in a way that it logs all exceptions, I think it is easier if we are not allowed to forget to send to sentry.

hlship15:08:11

It's out of scope for us to discuss Pedestal here, but lacinia-pedestal is designed to make it easy to inject your own interceptors into its Pedestal interceptor pipeline, so you can decide for yourself how to handle exceptions.