Skip to content

Commit

Permalink
fix: Throw original error
Browse files Browse the repository at this point in the history
  • Loading branch information
finom committed Jun 6, 2017
1 parent 0ec5e7d commit 4b0b4e1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions index.js
Expand Up @@ -41,8 +41,8 @@ console.log(`Cloning the repository to "${config.folder}" folder...`);
try {
execSync(`git clone -b ${config.branch} ${config.repository} ${config.folder} 2>&1`, { cwd });
} catch (e) {
throw Error('Failed to clone. '
+ `Check the repository name, permissions to clone and the absence of "${config.folder}" folder.`);
console.error('Failed to clone. An original error is thrown below.');
throw Error(e);
}


Expand All @@ -67,7 +67,8 @@ if (config.beforePushScript) {
${config.beforePushScript}
`, { cwd });
} catch (e) {
throw Error('Failed to run beforePushScript.');
console.error('Failed to run beforePushScript. An original error is thrown below.');
throw Error(e);
}
}

Expand All @@ -78,7 +79,8 @@ try {
git push --tags ${config.repository} ${config.branch} 2>&1
`, { cwd });
} catch (e) {
throw Error('Failed to push.');
console.error('Failed to push. An original error is thrown below.');
throw Error(e);
}


Expand Down

0 comments on commit 4b0b4e1

Please sign in to comment.