0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-14 11:09:04 -05:00

Minor improvements on error reporter.

This commit is contained in:
Andrey Antukh 2021-01-24 17:12:40 +01:00 committed by Alonso Torres
parent 5518f561f0
commit 0bbc006b98
4 changed files with 16 additions and 5 deletions

View file

@ -58,9 +58,15 @@
<body>
<div class="table">
<div class="table-row">
<div class="table-key">ERID: </div>
<div class="table-key" title="Error ID">ERID: </div>
<div class="table-val">{{id}}</div>
</div>
{% if profile-id %}
<div class="table-row">
<div class="table-key" title="Profile ID">PFID: </div>
<div class="table-val">{{profile-id}}</div>
</div>
{% endif %}
<div class="table-row">
<div class="table-key">VERS: </div>
<div class="table-val">{{version}}</div>

View file

@ -20,7 +20,6 @@
[app.util.json :as json]
[app.util.http :as http]
[app.util.template :as tmpl]
[clojure.pprint :refer [pprint]]
[clojure.core.async :as a]
[clojure.spec.alpha :as s]
[clojure.tools.logging :as log]
@ -74,7 +73,8 @@
[event]
(let [^LogEvent levent (deref event)
^ReadOnlyStringMap rosm (.getContextData levent)]
(into {:message (str event)}
(into {:message (str event)
:id (uuid/next)} ; set default uuid for cases when it not comes.
(comp
(map (fn [[key val]]
(cond

View file

@ -26,7 +26,9 @@
(ThreadContext/put
(name key)
(cond
(coll? val) (with-out-str (pprint val))
(coll? val)
(binding [clojure.pprint/*print-right-margin* 120]
(with-out-str (pprint val)))
(instance? clojure.lang.Named val) (name val)
:else (str val))))
data))

View file

@ -12,6 +12,7 @@
[clojure.spec.alpha :as s]
[integrant.core :as ig]
[app.db :as db]
[app.http.errors :refer [update-thread-context!]]
[buddy.core.codecs :as bc]
[buddy.core.nonce :as bn]))
@ -55,7 +56,9 @@
[cfg handler]
(fn [request]
(if-let [profile-id (retrieve-from-request cfg request)]
(handler (assoc request :profile-id profile-id))
(do
(update-thread-context! {:profile-id profile-id})
(handler (assoc request :profile-id profile-id)))
(handler request))))
(defmethod ig/pre-init-spec ::session [_]