mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 08:20:45 -05:00
✨ Minor change on error pruning mechanism.
This commit is contained in:
parent
4c18a1881b
commit
ea218839e4
1 changed files with 9 additions and 1 deletions
|
@ -20,11 +20,19 @@
|
|||
(get headers "x-real-ip")
|
||||
(get request :remote-addr)))
|
||||
|
||||
|
||||
(defn- simple-prune
|
||||
([s] (simple-prune s (* 1024 1024)))
|
||||
([s max-length]
|
||||
(if (> (count s) max-length)
|
||||
(str (subs s 0 max-length) " [...]")
|
||||
s)))
|
||||
|
||||
(defn- stringify-data
|
||||
[data]
|
||||
(binding [clojure.pprint/*print-right-margin* 200]
|
||||
(let [result (with-out-str (clojure.pprint/pprint data))]
|
||||
(str/prune result (* 1024 1024) "[...]"))))
|
||||
(simple-prune result (* 1024 1024)))))
|
||||
|
||||
(defn get-error-context
|
||||
[request error]
|
||||
|
|
Loading…
Reference in a new issue