From dbfa0e7a4b4b4c87a35d07fc15e4321500bfa5ad Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 26 Apr 2022 17:07:43 +0200 Subject: [PATCH] :bug: Fix unexpected exception on workspace libraries modal --- frontend/src/app/main/data/workspace/libraries.cljs | 3 +++ frontend/src/app/main/errors.cljs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index bd46a9951..b820336c6 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -18,6 +18,7 @@ [app.common.spec.file :as spec.file] [app.common.spec.typography :as spec.typography] [app.common.uuid :as uuid] + [app.main.data.dashboard :as dd] [app.main.data.events :as ev] [app.main.data.messages :as dm] [app.main.data.workspace.changes :as dch] @@ -38,6 +39,8 @@ ;; Change this to :info :debug or :trace to debug this module, or :warn to reset to default (log/set-level! :warn) +(s/def ::file ::dd/file) + (defn- log-changes [changes file] (let [extract-change diff --git a/frontend/src/app/main/errors.cljs b/frontend/src/app/main/errors.cljs index 163f70308..bccbd506e 100644 --- a/frontend/src/app/main/errors.cljs +++ b/frontend/src/app/main/errors.cljs @@ -11,6 +11,7 @@ [app.common.data.macros :as dm] [app.common.exceptions :as ex] [app.common.pprint :as pp] + [app.common.spec :as us] [app.config :as cf] [app.main.data.messages :as msg] [app.main.data.users :as du] @@ -131,6 +132,7 @@ (:name error) (dm/str cf/public-uri "js/cljs-runtime/" (:file error)) (:line error))] + (ts/schedule #(st/emit! (msg/show {:content "Internal error: assertion." :type :error @@ -139,6 +141,7 @@ ;; Print to the console some debugging info (js/console.group message) (js/console.info context) + (js/console.log (us/pretty-explain error)) (js/console.groupEnd message))) ;; That are special case server-errors that should be treated