Improve backend and worker error handling

This commit is contained in:
Andrey Antukh 2022-04-01 15:55:28 +02:00 committed by Andrés Moya
parent c026d05bc3
commit 701a98fab6
7 changed files with 112 additions and 47 deletions

View file

@ -54,9 +54,11 @@
(reply-error [cause]
(if (map? cause)
(post {:error cause})
(post {:error {:type :unexpected
:code :unhandled-error-on-worker
(post {:error {:type :worker-error
:code (or (:type cause) :wrapped)
:data cause}})
(post {:error {:type :worker-error
:code :unhandled-error
:hint (ex-message cause)
:data (ex-data cause)}})))