0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-16 17:51:18 -05:00

Complete http stream after a response es emitted.

This commit is contained in:
Andrey Antukh 2016-10-24 22:18:43 +02:00
parent ea9a096fa9
commit 658636463e
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -74,10 +74,11 @@
(letfn [(on-complete [event]
(if (or (= (.getLastErrorCode xhr) ErrorCode.HTTP_ERROR)
(.isSuccess xhr))
(sink {:status (.getStatus xhr)
:body (.getResponse xhr)
:headers (normalize-headers
(.getResponseHeaders xhr))})
(sink (rx/end
{:status (.getStatus xhr)
:body (.getResponse xhr)
:headers (normalize-headers
(.getResponseHeaders xhr))}))
(sink (let [type (-> (.getLastErrorCode xhr)
(translate-error-code))
message (.getLastError xhr)]