aws / aws/aws-sdk-js-codemod

[Feature]: Add trackable errors

Open
#481 0 comments 0 reactions 0 assignees View on GitHub
enhancement p3
Dominant language
TypeScript
Stars
89
Forks
13
Avg merge
9h 59m
Merged PRs (30d)
1

Description

### 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

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the referenced error sites in src/transforms/v2-to-v3/utils/getClientNewExpression.ts, src/transforms/v2-to-v3/modules/addClientNamedRequire.ts, and src/transforms/v2-to-v3/client-names/getV3ClientPackageName.ts. Compare how these JavaScript Errors are thrown, then determine a consistent trackable error approach. The work is done when codemod errors can be referenced by name or ID across these cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.