Skip to content

Commit 4b0b4e1

Browse files
committed
fix: Throw original error
1 parent 0ec5e7d commit 4b0b4e1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

index.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ console.log(`Cloning the repository to "${config.folder}" folder...`);
4141
try {
4242
execSync(`git clone -b ${config.branch} ${config.repository} ${config.folder} 2>&1`, { cwd });
4343
} catch (e) {
44-
throw Error('Failed to clone. '
45-
+ `Check the repository name, permissions to clone and the absence of "${config.folder}" folder.`);
44+
console.error('Failed to clone. An original error is thrown below.');
45+
throw Error(e);
4646
}
4747

4848

@@ -67,7 +67,8 @@ if (config.beforePushScript) {
6767
${config.beforePushScript}
6868
`, { cwd });
6969
} catch (e) {
70-
throw Error('Failed to run beforePushScript.');
70+
console.error('Failed to run beforePushScript. An original error is thrown below.');
71+
throw Error(e);
7172
}
7273
}
7374

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

8486

0 commit comments

Comments
 (0)