mirror of
https://github.com/penpot/penpot.git
synced 2026-09-18 18:06:14 +00:00
✨ Add better error handling for bool creation
This commit is contained in:
parent
cafb7abb53
commit
63cd3ae025
@ -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.files.helpers :as cpf]
|
[app.common.files.helpers :as cpf]
|
||||||
[app.common.geom.matrix :as gmt]
|
[app.common.geom.matrix :as gmt]
|
||||||
[app.common.geom.point :as gpt]
|
[app.common.geom.point :as gpt]
|
||||||
@ -205,8 +206,18 @@
|
|||||||
"Calculate the boolean content from shape and objects. Returns a
|
"Calculate the boolean content from shape and objects. Returns a
|
||||||
packed PathData instance"
|
packed PathData instance"
|
||||||
[shape objects]
|
[shape objects]
|
||||||
(-> (calc-bool-content* shape objects)
|
(ex/try!
|
||||||
(impl/path-data)))
|
(-> (calc-bool-content* shape objects)
|
||||||
|
(impl/path-data))
|
||||||
|
|
||||||
|
:on-exception
|
||||||
|
(fn [cause]
|
||||||
|
(ex/raise :type :internal
|
||||||
|
:code :invalid-path-content
|
||||||
|
:hint (str "unable to create bool content for shape " (:id shape))
|
||||||
|
:content (str (:content shape))
|
||||||
|
:shape-id (:id shape)
|
||||||
|
:cause cause))))
|
||||||
|
|
||||||
(defn update-bool-shape
|
(defn update-bool-shape
|
||||||
"Calculates the selrect+points for the boolean shape"
|
"Calculates the selrect+points for the boolean shape"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user