@forge/cli-shared 8.15.0-next.1 → 8.15.0-next.1-experimental-919607a
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.
|
@@ -27,6 +27,7 @@ export interface AutoAnalyzeErrorInput {
|
|
|
27
27
|
}
|
|
28
28
|
export declare const exitOnError: (logger: Logger, error: Error, hint?: string | null, autoAnalyzeErrorInput?: AutoAnalyzeErrorInput) => Promise<never>;
|
|
29
29
|
export declare const wrapError: (error: unknown) => Error;
|
|
30
|
+
export declare function transformErrorMessage(error: unknown, transformFn: (message: string) => string): Error;
|
|
30
31
|
export declare const assertIsError: (error: unknown) => asserts error is Error;
|
|
31
32
|
export declare class ValidationError extends UserError {
|
|
32
33
|
}
|
|
@@ -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;AAK/B,oBAAY,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,GAAG,SAAS,CAAC,GAAG;IACrF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAKF,MAAM,WAAW,kBAAkB;IACjC,aAAa,IAAI,cAAc,CAAC;CACjC;AAMD,wBAAgB,WAAW,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAe3C;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,GAAG,GAAG,cAAc,CAOzD;AAED,qBAAa,SAAU,SAAQ,KAAM,YAAW,kBAAkB;IAE9D,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAAV,SAAS,CAAC,oBAAoB,EACjD,OAAO,CAAC,EAAE,MAAM;IAKX,aAAa,IAAI,cAAc;IAM/B,WAAW,IAAI,OAAO;CAG9B;AAED,qBAAa,SAA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AoB,SAAQ,SAAS;gBAMpC,OAAO,CAAC,EAAE,MAAM;CAG7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MissingCreatorError = exports.PartialInstallationError = exports.UIPromptError = exports.ApplicationCompileError = exports.BundlerTSError = exports.ValidationError = exports.assertIsError = exports.wrapError = exports.exitOnError = exports.HiddenError = exports.UserError = exports.BaseError = exports.getErrorAttributes = exports.isUserError = void 0;
|
|
3
|
+
exports.MissingCreatorError = exports.PartialInstallationError = exports.UIPromptError = exports.ApplicationCompileError = exports.BundlerTSError = exports.ValidationError = exports.assertIsError = exports.transformErrorMessage = exports.wrapError = exports.exitOnError = exports.HiddenError = exports.UserError = exports.BaseError = exports.getErrorAttributes = exports.isUserError = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ui_1 = require("../ui");
|
|
6
6
|
const Sentry = tslib_1.__importStar(require("@sentry/node"));
|
|
@@ -99,6 +99,12 @@ const wrapError = (error) => {
|
|
|
99
99
|
return new Error(JSON.stringify(error));
|
|
100
100
|
};
|
|
101
101
|
exports.wrapError = wrapError;
|
|
102
|
+
function transformErrorMessage(error, transformFn) {
|
|
103
|
+
const originalMessage = error instanceof Error ? error.message : String(error);
|
|
104
|
+
const message = transformFn(originalMessage);
|
|
105
|
+
return isUserError(error) ? new UserError(message) : new Error(message);
|
|
106
|
+
}
|
|
107
|
+
exports.transformErrorMessage = transformErrorMessage;
|
|
102
108
|
const assertIsError = (error) => {
|
|
103
109
|
if (!(error instanceof Error)) {
|
|
104
110
|
throw new Error(`A non Error type object ${JSON.stringify(error)} of type '${typeof error}' was thrown.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/cli-shared",
|
|
3
|
-
"version": "8.15.0-next.1",
|
|
3
|
+
"version": "8.15.0-next.1-experimental-919607a",
|
|
4
4
|
"description": "Common functionality for Forge CLI",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"generate-graphql-types": "graphql-codegen --config src/graphql/codegen.yml"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@forge/manifest": "11.4.0-next.1",
|
|
15
|
+
"@forge/manifest": "11.4.0-next.1-experimental-919607a",
|
|
16
16
|
"@forge/util": "2.0.1",
|
|
17
17
|
"@forge/i18n": "0.0.7",
|
|
18
18
|
"@sentry/node": "7.106.0",
|