mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
Merge pull request #8575 from penpot/niwinz-staging-fetch-exception
🐛 Wrap fetch TypeError into proper ex-info with :unable-to-fetch code
This commit is contained in:
commit
c254f88367
@ -104,10 +104,17 @@
|
|||||||
(.next ^js subscriber response)
|
(.next ^js subscriber response)
|
||||||
(.complete ^js subscriber)))
|
(.complete ^js subscriber)))
|
||||||
(p/catch
|
(p/catch
|
||||||
(fn [err]
|
(fn [cause]
|
||||||
(vreset! abortable? false)
|
(vreset! abortable? false)
|
||||||
(when-not @unsubscribed?
|
(when-not @unsubscribed?
|
||||||
(.error ^js subscriber err))))
|
(let [error (ex-info (ex-message cause)
|
||||||
|
{:type :internal
|
||||||
|
:code :unable-to-fetch
|
||||||
|
:hint "unable to perform fetch operation"
|
||||||
|
:uri uri
|
||||||
|
:headers headers}
|
||||||
|
cause)]
|
||||||
|
(.error ^js subscriber error)))))
|
||||||
(p/finally
|
(p/finally
|
||||||
(fn []
|
(fn []
|
||||||
(let [{:keys [count average] :or {count 0 average 0}} (get @network-averages (:path uri))
|
(let [{:keys [count average] :or {count 0 average 0}} (get @network-averages (:path uri))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user