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
Introduce a new typed error into the CLI: ToolkitError, see errors.ts from aws-cdk-lib for an example however ToolkitError will not take a scope as input.
Implement a static isToolkitError message on the ToolkitError class
Implement an AuthenticationError that extends ToolkitError and sets type 'authentication'
Every error we throw in the CLI should throw ToolkitError or AuthenticationError depending on the situation.
Enforce this usage by configuring the no-throw-default-error rule from cdklabs/eslint-rules for the aws-cdk package (do this first)
Top tip: extend the linter fix suggestions here to add a new suggestion for ToolkitError/AuthenticationError. If you do that and enable the linter rule, changing every error will be almost automatic and super easy. I highly recommend you do this.
Errors that are re-thrown unchanged, should stay like that. Existing typed errors (like CfnEvaluationException) should be converted into our new error system.
Create all new files inside a new directory lib/toolkit. All files and classes should be private.
The text was updated successfully, but these errors were encountered:
ToolkitError
, see errors.ts fromaws-cdk-lib
for an example howeverToolkitError
will not take a scope as input.isToolkitError
message on theToolkitError
classAuthenticationError
that extendsToolkitError
and sets type'authentication'
ToolkitError
orAuthenticationError
depending on the situation.no-throw-default-error
rule from cdklabs/eslint-rules for theaws-cdk
package (do this first)ToolkitError
/AuthenticationError
. If you do that and enable the linter rule, changing every error will be almost automatic and super easy. I highly recommend you do this.Errors that are re-thrown unchanged, should stay like that. Existing typed errors (like
CfnEvaluationException
) should be converted into our new error system.Create all new files inside a new directory
lib/toolkit
. All files and classes should be private.The text was updated successfully, but these errors were encountered: