From dba195b39684039128db65e976c869ccb6fbaba0 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 11 Jul 2018 13:26:45 +0100 Subject: [PATCH] Add detection of connection timeout in git communication Fixes #1770 --- red/runtime/storage/localfilesystem/projects/git/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/red/runtime/storage/localfilesystem/projects/git/index.js b/red/runtime/storage/localfilesystem/projects/git/index.js index 196aece83..b6f3fa61a 100644 --- a/red/runtime/storage/localfilesystem/projects/git/index.js +++ b/red/runtime/storage/localfilesystem/projects/git/index.js @@ -48,7 +48,9 @@ function runGitCommand(args,cwd,env) { var err = new Error(stderr); err.stdout = stdout; err.stderr = stderr; - if(/Connection refused/i.test(stderr)) { + if (/Connection refused/i.test(stderr)) { + err.code = "git_connection_failed"; + } else if (/Connection timed out/i.test(stderr)) { err.code = "git_connection_failed"; } else if (/fatal: could not read/i.test(stderr)) { // Username/Password