@forge/cli-shared 3.2.0-next.1 → 3.2.0-next.2
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Logger } from '../ui';
|
|
2
2
|
export declare class HiddenError extends Error {
|
|
3
3
|
}
|
|
4
|
-
export declare const exitOnError: (logger: Logger
|
|
4
|
+
export declare const exitOnError: (logger: Logger, error?: Error | undefined, hint?: string | null | undefined) => never;
|
|
5
5
|
export declare const wrapError: (error: unknown) => Error;
|
|
6
6
|
export declare const assertIsError: (error: unknown) => asserts error is Error;
|
|
7
7
|
//# sourceMappingURL=error-handling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-handling.d.ts","sourceRoot":"","sources":["../../src/shared/error-handling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,qBAAa,WAAY,SAAQ,KAAK;CAAG;
|
|
1
|
+
{"version":3,"file":"error-handling.d.ts","sourceRoot":"","sources":["../../src/shared/error-handling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,qBAAa,WAAY,SAAQ,KAAK;CAAG;AAgBzC,eAAO,MAAM,WAAW,WAAY,MAAM,kEAAwC,KAgBjF,CAAC;AAOF,eAAO,MAAM,SAAS,UAAW,OAAO,KAAG,KAK1C,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,KAAK,IAAI,KAIhE,CAAC"}
|
|
@@ -11,13 +11,16 @@ function removePrefixFromErrorMessage(message) {
|
|
|
11
11
|
}
|
|
12
12
|
return message;
|
|
13
13
|
}
|
|
14
|
-
exports.exitOnError = (logger
|
|
14
|
+
exports.exitOnError = (logger, error, hint) => {
|
|
15
15
|
if (error) {
|
|
16
16
|
error.message = removePrefixFromErrorMessage(error.message);
|
|
17
17
|
if (!(error instanceof HiddenError))
|
|
18
18
|
logger.error(error);
|
|
19
|
-
if (!logger.debugEnabled) {
|
|
20
|
-
|
|
19
|
+
if (hint === undefined && !logger.debugEnabled) {
|
|
20
|
+
hint = ui_1.Text.rerunningWithVerbose;
|
|
21
|
+
}
|
|
22
|
+
if (hint) {
|
|
23
|
+
logger.info(hint);
|
|
21
24
|
}
|
|
22
25
|
return process.exit(1);
|
|
23
26
|
}
|