Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
fix: Catch errors from failed fetch requests (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
ynnoj committed Aug 24, 2017
1 parent 11ad8db commit 75c8e35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/factories/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class RequestFactory {

reject(response.json);
})
.catch(() => reject('Fetch error - check your network'));
.catch(error => reject(error));
});

promise.then((response) => {
Expand Down Expand Up @@ -87,7 +87,7 @@ class RequestFactory {

reject(response.json);
})
.catch(() => reject('Fetch error - check your network'));
.catch(error => reject(error));
};

if (!storage.get('mtoken') || Date.now().toString() >= storage.get('mexpires')) {
Expand Down

0 comments on commit 75c8e35

Please sign in to comment.