Skip to content

Commit

Permalink
fix(request-store-api): fix handling request error
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Jul 10, 2019
1 parent cb81d3d commit c8b89e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/methods/request-store-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ const requestStoreApi = (
})

.catch(err => {
if (baseURL === API_STORE_CACHE) {
let { response } = err
if (response && baseURL === API_STORE_CACHE) {
// retry with live Store API
let { status } = err.response
if (!status || status >= 500) {
let { status } = response
if (!status || status < 100 || status >= 500) {
isCacheOnline = false
setTimeout(() => { isCacheOnline = true }, 30000)
// resend request with same params
Expand Down

0 comments on commit c8b89e4

Please sign in to comment.