Skip to content

Commit 47fb302

Browse files
committed
make sure to stop a TestingBot tunnel when an error occurs and the tunnel is active
1 parent 5224648 commit 47fb302

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/commands/run.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ export default class RunProject {
224224
tunnelSpinner.clear();
225225
} catch (err) {
226226
log.error(chalk.white.bgRed.bold(err.message));
227+
await this.tunnel.stop();
227228
process.exit(1);
228229
}
229230
tunnelSpinner.succeed('TestingBot Tunnel Ready');
@@ -234,6 +235,9 @@ export default class RunProject {
234235
zipFile = await this.archiver.start();
235236
} catch (err) {
236237
log.error(chalk.white.bgRed.bold(err));
238+
if (config.run_settings.start_tunnel) {
239+
await this.tunnel.stop();
240+
}
237241
process.exit(1);
238242
}
239243

0 commit comments

Comments
 (0)