Skip to content

Commit c255ce3

Browse files
authored
Merge pull request #28 from umuttopalak/fix/git-pull
fix: improve error handling during repository pull for better user guidance
2 parents a353067 + 1d07c0f commit c255ce3

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

dist/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,13 @@ function run() {
254254
yield postConsoleInput(consoleRequestUrl, api_token, `git -C ${web_app.source_directory} pull\n`, "Repository Pulled.");
255255
}
256256
catch (error) {
257-
throw new Error(`Error during pulling repository: ${error.message}`);
257+
if (error.message.includes("Console not yet started")) {
258+
const consoleUrl = _console.console_url;
259+
throw new Error(`Activate your terminal: ${host}${consoleUrl}`);
260+
}
261+
else {
262+
throw new Error(`Error during pulling repository: ${error.message}`);
263+
}
258264
}
259265
if (framework_type == 'django') {
260266
try {

lib/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,13 @@ function run() {
247247
yield postConsoleInput(consoleRequestUrl, api_token, `git -C ${web_app.source_directory} pull\n`, "Repository Pulled.");
248248
}
249249
catch (error) {
250-
throw new Error(`Error during pulling repository: ${error.message}`);
250+
if (error.message.includes("Console not yet started")) {
251+
const consoleUrl = _console.console_url;
252+
throw new Error(`Activate your terminal: ${host}${consoleUrl}`);
253+
}
254+
else {
255+
throw new Error(`Error during pulling repository: ${error.message}`);
256+
}
251257
}
252258
if (framework_type == 'django') {
253259
try {

src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,12 @@ async function run() {
221221
try{
222222
await postConsoleInput(consoleRequestUrl, api_token, `git -C ${web_app.source_directory} pull\n`, "Repository Pulled.");
223223
} catch (error: any) {
224-
throw new Error(`Error during pulling repository: ${error.message}`);
224+
if (error.message.includes("Console not yet started")) {
225+
const consoleUrl = _console.console_url;
226+
throw new Error(`Activate your terminal: ${host}${consoleUrl}`);
227+
} else {
228+
throw new Error(`Error during pulling repository: ${error.message}`);
229+
}
225230
}
226231

227232
if (framework_type == 'django') {

0 commit comments

Comments
 (0)