Skip to content

Commit a85a8de

Browse files
committed
error handling
1 parent 0bcaa19 commit a85a8de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/commander/capture.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ command
2323
let ctx: Context = ctxInit(command.optsWithGlobals());
2424

2525
if (!fs.existsSync(file)) {
26-
console.log(`Error: Web Static Config file ${file} not found.`);
26+
ctx.log.error(`Web Static Config file ${file} not found.`);
2727
return;
2828
}
2929
try {
3030
ctx.webStaticConfig = JSON.parse(fs.readFileSync(file, 'utf8'));
3131
if (!validateWebStaticConfig(ctx.webStaticConfig)) throw new Error(validateWebStaticConfig.errors[0].message);
3232
if(ctx.webStaticConfig && ctx.webStaticConfig.length === 0) {
33-
console.log(`[smartui] Error: No URLs found in the specified config file -> ${file}`);
33+
ctx.log.error(`No URLs found in the specified config file -> ${file}`);
3434
return;
3535
}
3636
} catch (error: any) {
37-
console.log(`[smartui] Error: Invalid Web Static Config; ${error.message}`);
37+
ctx.log.error(`Invalid Web Static Config; ${error.message}`);
3838
return;
3939
}
4040
//Print Config here in debug mode

0 commit comments

Comments
 (0)