Skip to content

Commit c909a10

Browse files
committed
[FIX] Log error during initialization of UI5 CLI
Unexpected errors during initialization of the UI5 CLI are now properly logged to the console. Previously, such errors appeared as "TypeError [ERR_INVALID_ARG_TYPE]" error because "process.stderr.write" was called with the error object, not a string.
1 parent d3b4c83 commit c909a10

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

bin/ui5.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ if (process.env.NODE_ENV !== "test" || process.env.UI5_CLI_TEST_BIN_RUN_MAIN !==
117117
ui5.main().catch((err) => {
118118
process.stderr.write("Fatal Error: Unable to initialize UI5 CLI");
119119
process.stderr.write("\n");
120-
process.stderr.write(err);
120+
process.stderr.write(String(err));
121121
process.exit(1);
122122
});
123123
}

test/bin/ui5.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,5 @@ test.serial("integration: Executing main when required as main module (catch ini
374374

375375
t.deepEqual(processStderrWriteStub.getCall(0).args, ["Fatal Error: Unable to initialize UI5 CLI"]);
376376
t.is(processStderrWriteStub.getCall(2).args.length, 1);
377-
t.true(processStderrWriteStub.getCall(2).args[0] instanceof Error);
378-
t.is(processStderrWriteStub.getCall(2).args[0].message, "TEST: Unable to invoke CLI");
377+
t.is(processStderrWriteStub.getCall(2).args[0], "Error: TEST: Unable to invoke CLI");
379378
});

0 commit comments

Comments
 (0)