amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

fix: unhandled error when AWS config or profile don't exist

Open jonscheiding opened this issue 1 year ago • 0 comments

Description of changes

If the AWS profile specified in the Amplify config doesn't exist, or if the AWS config files themselves don't exist, various Amplify operations log this error:

🛑 Failed to get profile credentials
Cannot read properties of undefined (reading 'accessKeyId')

Depending on the operation and circumstances, this can be just a spurious message that doesn't interfere with the operation, or it can be an actual error.

Issue #, if available

Description of how you validated changes

  • Tested locally with modified version and a missing AWS profile

Checklist

  • [x] PR description included
  • [x] yarn test passes
  • [x] Tests are changed or added
  • [x] Relevant documentation is changed or added (and PR referenced)
  • [x] New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • [x] Pull request labels are added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

jonscheiding avatar Dec 06 '24 19:12 jonscheiding