Fork me on GitHub
#reitit
<
2019-05-30
>
ikitommi05:05:10

@worlds-endless about the redirect, currently, there is no option not to redirect, but there could be. Please write a issue about that if you still need it. I think you can do it now with a option :paths {"/index.html" <<resource-response-here>>} to the create-resource-handler.

phil11:05:41

Hey. I'm having an issue where an exception is being hidden behind a Malformed application/edn in :muuntaja/encode 500.

phil11:05:58

My exception middleware looks like this:

phil11:05:09

(def handle-exceptions
  (exception/create-exception-middleware
   (merge exception/default-handlers
          {org.postgresql.util.PSQLException parse-psql-error
           ::exception/default (fn [e req]
                                 (let [data (or (ex-data e) {})]
                                   {:status 400
                                    :body (merge {:type (type e)
                                                  :message (.getMessage e)}
                                                 data)}))
           :stripe-error (fn [e req]
                           (let [data (ex-data e)]
                             (error e)
                             {:status (:status data)
                              :body (merge {:message (.getMessage e)}
                                           data)}))
           :error (fn [e req]
                    (let [data (ex-data e)]
                      {:status (:status data)
                       :body (merge {:message (.getMessage e)}
                                    data)}))})))

phil11:05:28

I'm not sure how best to expose that exception - any tips?

josesanch15:05:32

Hi, is there any way to keywordize params with the defaults middleware?