-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove error incorrectly swallowed (fixes #13030) #13041
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## dev #13041 +/- ##
===========================================
+ Coverage 0.00% 48.45% +48.45%
===========================================
Files 1296 842 -454
Lines 149743 38035 -111708
Branches 1296 7790 +6494
===========================================
+ Hits 0 18430 +18430
+ Misses 148447 18014 -130433
- Partials 1296 1591 +295
... and 1244 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
74e3f5d
to
3229dd5
Compare
@@ -156,7 +156,7 @@ describe('remove-resource', () => { | |||
}, | |||
serviceSuffix: { Lambda: '(function)', LambdaLayer: '(layer)' }, | |||
}), | |||
).rejects.toThrowError('An error occurred when removing the resources from the local directory'); | |||
).rejects.toThrowError('Resource cannot be removed because it has a dependency on another resource'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also assert on the type of the error since that's usually the culprit for these issues
Description of changes
Ensure Amplify exceptions are not swallowed during resource removal. This was causing confusing error messages being shown when running
amplify remove <category>
.Current experience:
New error message:
Issue #, if available
Fixes #13030
Description of how you validated changes
Manual testing, yarn test
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.