aws-sdk-js-codemod icon indicating copy to clipboard operation
aws-sdk-js-codemod copied to clipboard

[Feature]: Add trackable errors

Open trivikr opened this issue 1 year ago • 0 comments

Self-service

  • [ ] I'd be willing to implement this feature

Problem

The existing Errors in codemod are not trackable. They're thrown as JavaScript Errors.

Examples:

  • https://github.com/awslabs/aws-sdk-js-codemod/blob/f76d1b449555c8aa22a92f62df221d6c7420b479/src/transforms/v2-to-v3/utils/getClientNewExpression.ts#L15-L17
  • https://github.com/awslabs/aws-sdk-js-codemod/blob/f76d1b449555c8aa22a92f62df221d6c7420b479/src/transforms/v2-to-v3/modules/addClientNamedRequire.ts#L84-L87
  • https://github.com/awslabs/aws-sdk-js-codemod/blob/f76d1b449555c8aa22a92f62df221d6c7420b479/src/transforms/v2-to-v3/client-names/getV3ClientPackageName.ts#L7

Solution

Add trackable errors in codemod, so that they can be referenced by name or IDs.

Alternatives

N/A

Additional context

Tip from CLI best practices https://github.com/lirantal/nodejs-cli-apps-best-practices#61-trackable-errors

trivikr avatar Apr 03 '23 02:04 trivikr