Skip to content

Commit

Permalink
Also check .status for HTTP error codes
Browse files Browse the repository at this point in the history
Fixes `get-file` not reliably refreshing auth on error
  • Loading branch information
dhleong committed Nov 17, 2018
1 parent 1781614 commit 1189cc8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cljs/wish/providers/gdrive.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
(go (let [[error resp] (<! (apply f args))]
(cond
(and error
(= 401 (.-code error)))
(= 401 (or (.-code error)
(.-status error))))
; refresh creds and retry
(let [_ (log/info "Refreshing auth before retrying " f "...")
[refresh-err refresh-resp] (<! (refresh-auth))]
Expand Down

0 comments on commit 1189cc8

Please sign in to comment.