Skip to content

Commit

Permalink
fix: Added another error scenario when the network connection disappears
Browse files Browse the repository at this point in the history
  • Loading branch information
batje committed Apr 12, 2018
1 parent 133ee4b commit 0c2412a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CognosRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ class CognosRequest {
})
.catch(function(err) {
// If there is another error, like a 500 or 404 (wrong URL)
if (err.response.status !== 441) {
// Also, if there is a network error there is no response
if (
typeof err.response === 'undefined' ||
err.response.status !== 441
) {
throw err.message;
}
me.log('Expected Error in initialise');
Expand Down

0 comments on commit 0c2412a

Please sign in to comment.