Skip to content

Commit 2fa67dd

Browse files
committed
Use console.error() to output error messages.
1 parent 0e979ca commit 2fa67dd

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

behavioral-patterns/memento/gamer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class Gamer {
5555
break;
5656
default:
5757
// Other...Exit
58-
console.log(`Unexpected value.`);
58+
console.error(`Unexpected value.`);
5959
process.exit(1);
6060
}
6161
// ˄

creational-patterns/abstract-factory/main.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ readline.question(``, (data) => {
2020
const input = Number(data);
2121
readline.close();
2222
if (isNaN(input)) {
23-
console.log(`Unexpected value.`);
23+
console.error(`Unexpected value.`);
2424
process.exit(1);
2525
}
2626

@@ -33,7 +33,7 @@ readline.question(``, (data) => {
3333
factory = new TableFactory();
3434
break;
3535
default:
36-
console.log(`The value is not 1 or 2.`);
36+
console.error(`The value is not 1 or 2.`);
3737
process.exit(1);
3838
}
3939

creational-patterns/builder/main.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ readline.question(``, (data) => {
3939
console.log(`Output File: ${path.join(process.cwd(), fileName)}`);
4040
}
4141
else {
42-
console.log(`The value is not "plain" or "html".`);
42+
console.error(`The value is not "plain" or "html".`);
4343
process.exit(1);
4444
}
4545
});

structural-patterns/decorator/side-frame.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class SideFrame extends Frame {
1818
super(display);
1919

2020
if (frameChar.length !== 1) {
21-
console.log(`Only one character is allowed in a side frame.`);
21+
console.error(`Only one character is allowed in a side frame.`);
2222
process.exit(1);
2323
}
2424
this.frameChar = frameChar;

0 commit comments

Comments
 (0)