From 75275201ed0747ff56fbfc77bc689b093e1c8766 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 31 Oct 2016 10:35:15 -0700 Subject: [PATCH] Added another error type to DNS fallback --- app/backend/network.js | 7 ++++++- app/package.json | 4 ++-- package.json | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/backend/network.js b/app/backend/network.js index 81e6fc36c1..0f8402d23d 100644 --- a/app/backend/network.js +++ b/app/backend/network.js @@ -109,7 +109,12 @@ export function _actuallySend (renderedRequest, settings, forceIPv4 = false) { const isShittyParseError = err.toString() === 'Error: Parse Error'; // Failed to connect while prioritizing IPv6 address, fallback to IPv4 - if (!forceIPv4 && err.code === 'ECONNREFUSED') { + const isNetworkRelatedError = ( + err.code === 'ECONNREFUSED' || // Could not talk to server + err.code === 'ENETUNREACH' // Could not access the network + ); + + if (!forceIPv4 && isNetworkRelatedError) { console.log('-- Falling back to IPv4 --'); _actuallySend(renderedRequest, settings, true).then(resolve, reject); return; diff --git a/app/package.json b/app/package.json index 19e411f058..c26544ceed 100644 --- a/app/package.json +++ b/app/package.json @@ -22,11 +22,11 @@ "nedb": "^1.8.0", "node-forge": "^0.6.43", "node-uuid": "^1.4.7", - "nunjucks": "git@github.com:gschier/nunjucks.git#80485468cd577f1a1a8067bedf6c5bfa878712ea", + "nunjucks": "git@github.com:getinsomnia/nunjucks.git#80485468cd577f1a1a8067bedf6c5bfa878712ea", "raven": "^0.12.1", "request": "^2.71.0", "sjcl": "^1.0.6", - "srp": "git@github.com:gschier/node-srp.git#5dfcdba97e3661ba1119cadbc4e9723c6b4bc1fb", + "srp": "git@github.com:getinsomnia/node-srp.git#6ebd8c3acfbcf69645e4c6e6f8f6b55138ff22c3", "tough-cookie": "^2.3.1", "traverse": "^0.6.6", "vkbeautify": "^0.99.1", diff --git a/package.json b/package.json index 7ec6542a09..0fdf321c1a 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "nedb": "^1.8.0", "node-forge": "^0.6.43", "node-uuid": "^1.4.7", - "nunjucks": "git@github.com:gschier/nunjucks.git#80485468cd577f1a1a8067bedf6c5bfa878712ea", + "nunjucks": "git@github.com:getinsomnia/nunjucks.git#80485468cd577f1a1a8067bedf6c5bfa878712ea", "raven": "^0.12.1", "react": "^15.3.1", "react-dnd": "^2.1.4", @@ -86,7 +86,7 @@ "redux-thunk": "^2.0.1", "request": "^2.74.0", "sjcl": "^1.0.6", - "srp": "git@github.com:gschier/node-srp.git#5dfcdba97e3661ba1119cadbc4e9723c6b4bc1fb", + "srp": "git@github.com:getinsomnia/node-srp.git#6ebd8c3acfbcf69645e4c6e6f8f6b55138ff22c3", "tough-cookie": "^2.3.1", "traverse": "^0.6.6", "vkbeautify": "^0.99.1",