Skip to content

Commit

Permalink
chore: change printAmplifyException instead of aws-cfn
Browse files Browse the repository at this point in the history
  • Loading branch information
0.618 committed May 13, 2024
1 parent 8f59370 commit 30aa596
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions packages/amplify-cli/src/amplify-exception-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ const executeSafely = async (functionToExecute: () => Promise<void> | void, erro

const printAmplifyException = (amplifyException: AmplifyException): void => {
const { message, details, resolution, link, stack } = amplifyException;

printer.error(message);
if (message === 'Resource is not in the state stackUpdateComplete') {
// This change is to help Studio log more details to save another round of log analysis.
printer.error(message + details);
} else {
printer.error(message);
}
if (details) {
printer.info(details);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* eslint-disable */
const fs = require('fs-extra');
const path = require('path');
const { EOL } = require('os');
const _ = require('lodash');
const BottleNeck = require('bottleneck');
const chalk = require('chalk');
Expand Down Expand Up @@ -419,7 +418,7 @@ class CloudFormation {

if (completeErr) {
await this.collectStackErrors(cfnParentStackParams.StackName).then((errorDetails) => {
completeErr.message = `${completeErr.message}${EOL}${errorDetails}`;
completeErr.details = errorDetails;
reject(completeErr);
});
} else {
Expand Down

0 comments on commit 30aa596

Please sign in to comment.