Improve worker error handling

Use the global error handlers for handle
also the worker errors.
This commit is contained in:
Andrey Antukh 2022-03-22 17:24:36 +01:00 committed by Alonso Torres
parent 9582cc0211
commit b87e3c22b3
2 changed files with 9 additions and 9 deletions

View file

@ -7,19 +7,16 @@
(ns app.main.worker
(:require
[app.config :as cfg]
[app.main.errors :as err]
[app.util.worker :as uw]))
(defn on-error
[error]
(js/console.error "Error on worker" (pr-str error)))
(defonce instance (atom nil))
(defn init!
[]
(reset!
instance
(uw/init cfg/worker-uri on-error)))
(uw/init cfg/worker-uri err/on-error)))
(defn ask!
[message]