Skip to content

Commit 1143149

Browse files
Sebastian McKenziebestander
authored andcommitted
Always output with reporter.error when encountering CLI errors (#148)
* always output with reporter.error when encountering cli errors * remove "Error: " from message when outputing CLI errors
1 parent 37d4510 commit 1143149

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/cli/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import buildExecuteLifecycleScript from "./commands/_execute-lifecycle-script.js";
1313
import { ConsoleReporter, JSONReporter } from "../reporters/index.js";
14-
import { MessageError } from "../errors.js";
1514
import * as commands from "./commands/index.js";
1615
import * as constants from "../constants.js";
1716
import * as network from "../util/network.js";
@@ -184,11 +183,7 @@ config.init().then(() => {
184183
return run().then(process.exit);
185184
}).catch(function (errs) {
186185
function logError(err) {
187-
if (err instanceof MessageError) {
188-
reporter.error(err.stack);
189-
} else {
190-
console.error(err.stack);
191-
}
186+
reporter.error(err.stack.replace(/^Error: /, ""));
192187
}
193188

194189
if (Array.isArray(errs)) {

0 commit comments

Comments
 (0)