enhance(cli): export-edn prints unexpected errors

especially when an invalid export-type is given
This commit is contained in:
Gabriel Horner
2025-11-18 09:51:20 -05:00
parent 8c3e4f25c7
commit 5489e7572f
5 changed files with 13 additions and 10 deletions

View File

@@ -694,6 +694,8 @@
(when-let [conn (worker-state/get-datascript-conn repo)]
(worker-db-validate/validate-db conn)))
;; Returns an export-edn map for given repo. When there's an unexpected error, a map
;; with key :export-edn-error is returned
(def-thread-api :thread-api/export-edn
[repo options]
(let [conn (worker-state/get-datascript-conn repo)]
@@ -705,7 +707,7 @@
(worker-util/post-message :notification
["An unexpected error occurred during export. See the javascript console for details."
:error])
:export-edn-error))))
{:export-edn-error (.-message e)}))))
(def-thread-api :thread-api/get-view-data
[repo view-id option]