From 63cd3ae025c5957e394624c1abc9489b273d70bc Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 3 Jul 2025 14:53:02 +0200 Subject: [PATCH] :sparkles: Add better error handling for bool creation --- common/src/app/common/types/path.cljc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/common/src/app/common/types/path.cljc b/common/src/app/common/types/path.cljc index eb0398787a..bcfa323c82 100644 --- a/common/src/app/common/types/path.cljc +++ b/common/src/app/common/types/path.cljc @@ -8,6 +8,7 @@ (:require [app.common.data :as d] [app.common.data.macros :as dm] + [app.common.exceptions :as ex] [app.common.files.helpers :as cpf] [app.common.geom.matrix :as gmt] [app.common.geom.point :as gpt] @@ -205,8 +206,18 @@ "Calculate the boolean content from shape and objects. Returns a packed PathData instance" [shape objects] - (-> (calc-bool-content* shape objects) - (impl/path-data))) + (ex/try! + (-> (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 "Calculates the selrect+points for the boolean shape"