@sechroom/cli 2026.7.18 → 2026.7.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -657,9 +657,14 @@ async function runApi(label, fn) {
|
|
|
657
657
|
s.succeed();
|
|
658
658
|
return res.data;
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function formatFailureMessage(error) {
|
|
661
661
|
let msg;
|
|
662
|
-
if (
|
|
662
|
+
if (error instanceof Error) {
|
|
663
|
+
msg = error.message || error.name;
|
|
664
|
+
if (error.cause instanceof Error && error.cause.message) {
|
|
665
|
+
msg += `: ${error.cause.message}`;
|
|
666
|
+
}
|
|
667
|
+
} else if (typeof error === "object" && error !== null && "title" in error) {
|
|
663
668
|
const problem = error;
|
|
664
669
|
msg = String(problem.title);
|
|
665
670
|
if (problem.errors && typeof problem.errors === "object") {
|
|
@@ -674,6 +679,10 @@ ${detail.join("\n")}`;
|
|
|
674
679
|
} else {
|
|
675
680
|
msg = String(error);
|
|
676
681
|
}
|
|
682
|
+
return msg;
|
|
683
|
+
}
|
|
684
|
+
function fail(error) {
|
|
685
|
+
const msg = formatFailureMessage(error);
|
|
677
686
|
process.stderr.write(`error: ${msg}
|
|
678
687
|
`);
|
|
679
688
|
process.exit(1);
|
package/package.json
CHANGED