@forge/cli-shared

8.5.0-next.78.5.0-next.8
out/shared/error-handling.js
~out/shared/error-handling.jsModified
+5−1
Index: package/out/shared/error-handling.js
===================================================================
--- package/out/shared/error-handling.js
+++ package/out/shared/error-handling.js
@@ -3,8 +3,9 @@
 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;
 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");
 function isErrorWithAnalytics(e) {
     return e.getAttributes !== undefined;
 }
 function isUserError(e) {
@@ -65,9 +66,9 @@
         return message.replace('error: ', '');
     }
     return message;
 }
-const exitOnError = async (logger, error, hint) => {
+const exitOnError = async (logger, error, hint, autoAnalyzeErrorInput) => {
     let exitCode = 0;
     Sentry.withScope((scope) => {
         scope.setTag('userError', isUserError(error));
         scope.setFingerprint(['{{ default }}', '{{ tags.command.name }}']);
@@ -84,8 +85,11 @@
         logger.info(hint);
     }
     exitCode = 1;
     await Sentry.close();
+    if (autoAnalyzeErrorInput?.prompt && autoAnalyzeErrorInput?.assistantName) {
+        await (0, assistant_cli_1.runAssistant)(autoAnalyzeErrorInput.prompt, autoAnalyzeErrorInput.assistantName, logger);
+    }
     process.exit(exitCode);
 };
 exports.exitOnError = exitOnError;
 const wrapError = (error) => {