🐛 Properly report importation errors

This commit is contained in:
Andrey Antukh 2024-06-26 14:59:38 +02:00
parent 8a63089773
commit 37d0cec265
2 changed files with 13 additions and 15 deletions

View file

@ -61,6 +61,8 @@
(let [result (handler)] (let [result (handler)]
(events/tap :end result)) (events/tap :end result))
(catch Throwable cause (catch Throwable cause
(l/err :hint "unexpected error on processing sse response"
:cause cause)
(events/tap :error (errors/handle' cause request))) (events/tap :error (errors/handle' cause request)))
(finally (finally
(sp/close! events/*channel*) (sp/close! events/*channel*)

View file

@ -30,14 +30,12 @@
;; --- Command: export-binfile ;; --- Command: export-binfile
(def ^:private (def ^:private schema:export-binfile
schema:export-binfile [:map {:title "export-binfile"}
(sm/define [:name :string]
[:map {:title "export-binfile"} [:file-id ::sm/uuid]
[:name :string] [:include-libraries :boolean]
[:file-id ::sm/uuid] [:embed-assets :boolean]])
[:include-libraries :boolean]
[:embed-assets :boolean]]))
(sv/defmethod ::export-binfile (sv/defmethod ::export-binfile
"Export a penpot file in a binary format." "Export a penpot file in a binary format."
@ -76,13 +74,11 @@
{:id project-id}) {:id project-id})
result)) result))
(def ^:private (def ^:private schema:import-binfile
schema:import-binfile [:map {:title "import-binfile"}
(sm/define [:name :string]
[:map {:title "import-binfile"} [:project-id ::sm/uuid]
[:name :string] [:file ::media/upload]])
[:project-id ::sm/uuid]
[:file ::media/upload]]))
(sv/defmethod ::import-binfile (sv/defmethod ::import-binfile
"Import a penpot file in a binary format." "Import a penpot file in a binary format."