Skip to content

Commit 9670064

Browse files
mjdickinsonmadisonsmith
authored andcommitted
Categorize ETIMEDOUT errors as PNNetworkIssuesCategory (pubnub#126)
1 parent 156d4c5 commit 9670064

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/networking/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ export default class {
9696
if (err.status === 0 || (err.hasOwnProperty('status') && typeof err.status === 'undefined')) return categoryConstants.PNNetworkIssuesCategory;
9797
if (err.timeout) return categoryConstants.PNTimeoutCategory;
9898

99+
if (err.code === 'ETIMEDOUT') return categoryConstants.PNNetworkIssuesCategory;
100+
99101
if (err.response) {
100102
if (err.response.badRequest) return categoryConstants.PNBadRequestCategory;
101103
if (err.response.forbidden) return categoryConstants.PNAccessDeniedCategory;

0 commit comments

Comments
 (0)