Browse Source

fix(cli): Further reformat error logging due to eligibility

HouseinIsProgramming 7 months ago
parent
commit
77c962ced9
1 changed files with 3 additions and 3 deletions
  1. 3 3
      packages/cli/src/commands/add/add.ts

+ 3 - 3
packages/cli/src/commands/add/add.ts

@@ -46,10 +46,10 @@ async function handleNonInteractiveMode(options: AddOperationOptions) {
             const stackLines = e.stack.split('\n');
             const stackLines = e.stack.split('\n');
             const stackTrace = stackLines.slice(1).join('\n'); // Remove first line (error message)
             const stackTrace = stackLines.slice(1).join('\n'); // Remove first line (error message)
 
 
-            // Display colored error message, newline, then stack trace
-            log.error(pc.red('Error:') + ' ' + String(errorMessage));
-            log.error(''); // Add empty line for better readability
+            // Display stack trace first, then colored error message at the end
             log.error(stackTrace);
             log.error(stackTrace);
+            log.error(''); // Add empty line for better readability
+            log.error(pc.red('Error:') + ' ' + String(errorMessage));
         } else {
         } else {
             log.error(e.message as string);
             log.error(e.message as string);
             if (e.stack) {
             if (e.stack) {