Forráskód Böngészése

enhance(rtc): update e->ex-info to handle m/race-failure

rcmerci 1 hónapja
szülő
commit
68c5ab1bca
1 módosított fájl, 6 hozzáadás és 0 törlés
  1. 6 0
      src/main/frontend/worker/rtc/exception.cljs

+ 6 - 0
src/main/frontend/worker/rtc/exception.cljs

@@ -57,4 +57,10 @@ the server will put it to s3 and return its presigned-url to clients."}
   (cond
   (cond
     (instance? Cancelled e) (ex-info "missionary.Cancelled" {:message (.-message e)})
     (instance? Cancelled e) (ex-info "missionary.Cancelled" {:message (.-message e)})
     (instance? js/CloseEvent e) (ex-info "js/CloseEvent" {:type (.-type e)})
     (instance? js/CloseEvent e) (ex-info "js/CloseEvent" {:type (.-type e)})
+
+    ;; m/race-failure
+    (and (instance? ExceptionInfo e)
+         (contains? (ex-data e) :missionary.core/errors))
+    (ex-info (ex-message e) (update (ex-data e) :missionary.core/errors (fn [errors] (map e->ex-info errors))))
+
     :else e))
     :else e))