Use catch :default for default error handling in cljs

This is considered normal practice for cljs. See
https://clojure.atlassian.net/browse/CLJS-661 for when it was introduced
and background on it
This commit is contained in:
Gabriel Horner
2022-09-22 10:19:35 -04:00
committed by Tienson Qin
parent ae114afbd8
commit 2ce6dfad41
49 changed files with 82 additions and 82 deletions

View File

@@ -35,7 +35,7 @@
[type & args]
(try
(apply js-invoke (aget js/window.logseq "api") type args)
(catch js/Error e (js/console.error e))))
(catch :default e (js/console.error e))))
;; state handlers
(defonce central-endpoint "https://raw.githubusercontent.com/logseq/marketplace/master/")
@@ -153,7 +153,7 @@
[id]
(try
(js/LSPluginCore.ensurePlugin (name id))
(catch js/Error _e
(catch :default _e
nil)))
(defn open-updates-downloading
@@ -431,7 +431,7 @@
matched)))
content)]
(format/to-html content :markdown (gp-mldoc/default-config :markdown))))
(catch js/Error e
(catch :default e
(log/error :parse-user-md-exception e)
content)))
@@ -472,7 +472,7 @@
(bean/->js (normalize-keyword-for-json payload))
payload)
(if (keyword? plugin-id) (name plugin-id) plugin-id))
(catch js/Error e
(catch :default e
(js/console.error "[Hook Plugin Err]" e)))))
(defn hook-plugin-app