@forge/cli-shared
8.24.08.24.0-experimental-04cc2b9
out/shared/error-handling.js~
out/shared/error-handling.jsModified+4−4
Index: package/out/shared/error-handling.js
===================================================================
--- package/out/shared/error-handling.js
+++ package/out/shared/error-handling.js
@@ -1,7 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-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;
+exports.MissingCreatorError = exports.PartialInstallationError = exports.UIPromptError = exports.ApplicationCompileError = exports.BundlerTSError = exports.ValidationError = exports.assertIsError = exports.wrapError = exports.exitOnError = exports.HiddenError = exports.UserError = exports.BaseError = void 0;
+exports.isUserError = isUserError;
+exports.getErrorAttributes = getErrorAttributes;
+exports.transformErrorMessage = transformErrorMessage;
const tslib_1 = require("tslib");
const ui_1 = require("../ui");
const Sentry = tslib_1.__importStar(require("@sentry/node"));
const assistant_cli_1 = require("./assistant-cli");
@@ -18,18 +21,16 @@
}
}
return false;
}
-exports.isUserError = isUserError;
function getErrorAttributes(e) {
const result = {};
if (isErrorWithAnalytics(e)) {
Object.assign(result, e.getAttributes());
}
result.isUserError = isUserError(e);
return result;
}
-exports.getErrorAttributes = getErrorAttributes;
class BaseError extends Error {
requestId;
constructor(requestId, message) {
super(message);
@@ -103,9 +104,8 @@
const originalMessage = error instanceof Error ? error.message : String(error);
const message = transformFn(originalMessage);
return isUserError(error) ? new UserError(message) : new Error(message);
}
-exports.transformErrorMessage = transformErrorMessage;
const assertIsError = (error) => {
if (!(error instanceof Error)) {
throw new Error(`A non Error type object ${JSON.stringify(error)} of type '${typeof error}' was thrown.`);
}