mirror of
https://github.com/penpot/penpot.git
synced 2025-05-22 09:56:11 +02:00
✨ Add better exception reporting on commit-changes
This commit is contained in:
parent
7efeeec9b1
commit
3eb2569465
1 changed files with 7 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
(:require
|
(:require
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
|
[app.common.exceptions :as ex]
|
||||||
[app.common.logging :as log]
|
[app.common.logging :as log]
|
||||||
[app.common.pages :as cp]
|
[app.common.pages :as cp]
|
||||||
[app.common.pages.changes :as cpc]
|
[app.common.pages.changes :as cpc]
|
||||||
|
@ -205,6 +206,7 @@
|
||||||
path (if (= file-id current-file-id)
|
path (if (= file-id current-file-id)
|
||||||
[:workspace-data]
|
[:workspace-data]
|
||||||
[:workspace-libraries file-id :data])]
|
[:workspace-libraries file-id :data])]
|
||||||
|
|
||||||
(try
|
(try
|
||||||
(dm/assert!
|
(dm/assert!
|
||||||
"expect valid vector of changes"
|
"expect valid vector of changes"
|
||||||
|
@ -217,7 +219,11 @@
|
||||||
(ctst/update-object-indices page-id))))
|
(ctst/update-object-indices page-id))))
|
||||||
|
|
||||||
(catch :default err
|
(catch :default err
|
||||||
(log/error :js/error err)
|
(when-let [data (ex-data err)]
|
||||||
|
(js/console.log (ex/explain data)))
|
||||||
|
|
||||||
|
(when (ex/error? err)
|
||||||
|
(js/console.log (.-stack ^js err)))
|
||||||
(vreset! error err)
|
(vreset! error err)
|
||||||
state))))
|
state))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue