🐛 Fix exception on copy action from context menu.

This commit is contained in:
Andrey Antukh 2020-12-21 15:32:36 +01:00 committed by Alonso Torres
parent b4b88bde0b
commit dea5cf4b5d
3 changed files with 10 additions and 8 deletions

View file

@ -266,19 +266,21 @@
(defmethod ptk/handle-error :default
[error]
(js/console.log error)
(if (instance? ExceptionInfo error)
(ptk/handle-error (ex-data error))
(do
(js/console.group "Generic Error:")
(js/console.group "Generic Error")
(js/console.log "hint:" (or (ex-message error)
(:hint error)
(:message error)))
(ex/ignoring
(js/console.error (pr-str error))
(js/console.error (.-stack error)))
(js/console.error "repr: " (pr-str error))
(js/console.error "stack:" (.-stack error)))
(js/console.groupEnd "Generic error")
(ts/schedule (st/emitf (dm/show
{:content "Something wrong has happened."
:type :error
:timeout 5000}))))))
:timeout 3000}))))))
(defmethod ptk/handle-error :server-error
[{:keys [status] :as error}]