aws-amplify / amplify-backend

Home to all tools related to Amplify's code-first DX (Gen 2) for building fullstack apps on AWS
Apache License 2.0
184 stars 62 forks source link

Prefer amplify errors in generators #2035

Closed sobolk closed 1 month ago

sobolk commented 1 month ago

Changes

This PR revises expectations about errors for X-generator packages to prefer Amplify Errors.

Reasons:

  1. We already use Amplify Errors in them. Changing that would be a break.
  2. Translating errors in CLI would leak implementation details. This is unwanted.
  3. In order to surface necessary information each of them would need to use error system similar to Amplify Errors.
  4. Amplify Errors are part if platform-types. I.e. usable not only in "cli-ish" packages.

Out of scope

I fixed only one violation which was simple and left rest for the future. The priority is to establish these rules.

Validation

PR checks.

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 8414a85520bdc9b081ed7b13a73c75704222535d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages | Name | Type | | ----------------------------- | ----- | | @aws-amplify/schema-generator | Patch | | @aws-amplify/model-generator | Patch | | @aws-amplify/form-generator | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR