0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

Fix minor issues on error reporting.

This commit is contained in:
Andrey Antukh 2022-01-17 13:08:29 +01:00
parent b6f460940f
commit bda97adf4f
4 changed files with 5 additions and 3 deletions

View file

@ -77,7 +77,9 @@
(handler request)
(catch Throwable e
(l/with-context (errors/get-error-context request e)
(l/error :hint (ex-message e) :cause e)
(l/error :hint "unexpected error processing request"
:query-string (:query-string request)
:cause e)
{:status 500 :body "internal server error"}))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -150,7 +150,7 @@
(binding [ppr/*print-right-margin* 300]
(let [context (dissoc report
:trace :cause :params :data :spec-problems
:spec-value :error :explain :hint :message)
:spec-value :error :explain :hint)
params {:context (with-out-str (ppr/pprint context))
:hint (:hint report)
:spec-problems (:spec-problems report)

View file

@ -34,7 +34,6 @@
:data (some-> data (dissoc ::s/problems ::s/value :hint))
:ip-addr (parse-client-ip request)
:profile-id (:profile-id request)}
(let [headers (:headers request)]
{:user-agent (get headers "user-agent")
:frontend-version (get headers "x-frontend-version" "unknown")}))))

View file

@ -70,6 +70,7 @@
(let [body (:body response)
params (:query-params request)
opts {:type (if (contains? params "transit_verbose") :json-verbose :json)}]
(cond
(:ws response)
response