@@ -29044,6 +29044,69 @@ module.exports = {
2904429044}
2904529045
2904629046
29047+ /***/ }),
29048+
29049+ /***/ 823:
29050+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
29051+
29052+ "use strict";
29053+
29054+ var __importDefault = (this && this.__importDefault) || function (mod) {
29055+ return (mod && mod.__esModule) ? mod : { "default": mod };
29056+ };
29057+ Object.defineProperty(exports, "__esModule", ({ value: true }));
29058+ exports.formatAxiosError = formatAxiosError;
29059+ exports.logAxiosError = logAxiosError;
29060+ exports.isAxiosError = isAxiosError;
29061+ const axios_1 = __importDefault(__nccwpck_require__(8757));
29062+ /**
29063+ * Formats an AxiosError into a concise, readable error message
29064+ * Includes: HTTP method, URL, status code, and response body (typically error message)
29065+ * Excludes verbose config details that cause thousands of lines of output
29066+ */
29067+ function formatAxiosError(error) {
29068+ const parts = [];
29069+ if (error.config) {
29070+ if (error.config.method) {
29071+ parts.push(`Method: ${error.config.method.toUpperCase()}`);
29072+ }
29073+ if (error.config.url) {
29074+ parts.push(`URL: ${error.config.url}`);
29075+ }
29076+ }
29077+ if (error.response) {
29078+ parts.push(`Status: ${error.response.status}`);
29079+ if (error.response.data) {
29080+ const responseData = error.response.data;
29081+ if (typeof responseData === 'string') {
29082+ parts.push(`Response: ${responseData}`);
29083+ }
29084+ else if (typeof responseData === 'object') {
29085+ parts.push(`Response: ${JSON.stringify(responseData)}`);
29086+ }
29087+ }
29088+ }
29089+ else if (error.message) {
29090+ parts.push(`Error: ${error.message}`);
29091+ }
29092+ return parts.join(' | ');
29093+ }
29094+ /**
29095+ * Logs an AxiosError with concise formatting
29096+ * HTTP errors are considered "expected" and are treated as fully handled
29097+ */
29098+ function logAxiosError(error, coreAdapter, context) {
29099+ const formattedError = formatAxiosError(error);
29100+ coreAdapter.error(`${context}: ${formattedError}`);
29101+ }
29102+ /**
29103+ * Determines if an error is an AxiosError
29104+ */
29105+ function isAxiosError(error) {
29106+ return axios_1.default.isAxiosError(error);
29107+ }
29108+
29109+
2904729110/***/ }),
2904829111
2904929112/***/ 6144:
@@ -29084,6 +29147,7 @@ const axios_1 = __importDefault(__nccwpck_require__(8757));
2908429147const fs = __importStar(__nccwpck_require__(7147));
2908529148const path = __importStar(__nccwpck_require__(1017));
2908629149const os = __importStar(__nccwpck_require__(2037));
29150+ const error_utils_1 = __nccwpck_require__(823);
2908729151async function runAuth(coreAdapter = core) {
2908829152 try {
2908929153 const clientId = coreAdapter.getInput('client_id');
@@ -29120,14 +29184,8 @@ async function runAuth(coreAdapter = core) {
2912029184 const fileToken = fileTokenData.token;
2912129185 }
2912229186 catch (authError) {
29123- if (axios_1.default.isAxiosError(authError)) {
29124- if (authError.response) {
29125- coreAdapter.error(`Authentication error response: ${JSON.stringify(authError.response.data)}`);
29126- coreAdapter.error(`Status code: ${authError.response.status}`);
29127- }
29128- else {
29129- coreAdapter.error(`Authentication error message: ${authError.message}`);
29130- }
29187+ if ((0, error_utils_1.isAxiosError)(authError)) {
29188+ (0, error_utils_1.logAxiosError)(authError, coreAdapter, 'Authentication error');
2913129189 }
2913229190 else {
2913329191 coreAdapter.error(`Unexpected error: ${authError}`);
@@ -29136,12 +29194,25 @@ async function runAuth(coreAdapter = core) {
2913629194 }
2913729195 }
2913829196 catch (error) {
29139- coreAdapter.setFailed(`Action failed with error: ${error}`);
29197+ // Exception handler of last resort
29198+ if (error instanceof Error) {
29199+ coreAdapter.setFailed(error.message);
29200+ }
29201+ else {
29202+ coreAdapter.setFailed(`An unknown error occurred: ${error}`);
29203+ }
2914029204 throw error;
2914129205 }
2914229206}
2914329207async function run() {
29144- await runAuth(core);
29208+ try {
29209+ await runAuth(core);
29210+ }
29211+ catch (error) {
29212+ // Last-resort exception handler: prevent unhandled rejections
29213+ // The error has already been logged and setFailed has been called
29214+ process.exit(1);
29215+ }
2914529216}
2914629217// Only run if this file is executed directly (not imported)
2914729218if (require.main === require.cache[eval('__filename')]) {
0 commit comments