You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently all errors thrown by the AWS CDK in aws-cdk-lib etc are regular untyped Errors. That makes it difficult for a caller to distinguish between errors thrown intentionally by the construct library, and other errors like coding bugs etc.
The CDK should only throw well typed errors.
All errors should be categorized into the type of error they are (most are going to be validation errors).
### Reason for this change
As part of #32324 we are enforcing stricter rules on thrown errors.
### Description of changes
Enforce the `no-throw-literal` eslint rule.
Fix the one instance that wasn't compliant yet.
### Description of how you validated changes
Manual testing. Only changed code is in supporting CLI tool.
### Checklist
- [x] My code adheres to the [CONTRIBUTING
GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and
[DESIGN
GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license*
Currently all errors thrown by the AWS CDK in
aws-cdk-lib
etc are regular untypedError
s. That makes it difficult for a caller to distinguish between errors thrown intentionally by the construct library, and other errors like coding bugs etc.The CDK should only throw well typed errors.
All errors should be categorized into the type of error they are (most are going to be validation errors).
We should enforce this by writing an eslint rule.
Subtasks
The text was updated successfully, but these errors were encountered: