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
185 stars 62 forks source link

fix: truncate large error messages before printing to customer #2260

Closed Amplifiyer closed 10 hours ago

Amplifiyer commented 12 hours ago

Problem

Sometimes CDK CLI prints a massive uglified code on the stderr when an error happens. This may mask the actual error message to be shown to customers.

Issue number, if available:

Changes

Truncate and keep the later part of the error message.

Corresponding docs PR, if applicable:

Validation

Tested manually. I couldn't figure out a clean way to mock execa child process to be able to test this.

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 12 hours ago

🦋 Changeset detected

Latest commit: 0b3581d59e709a5a7551daac1d4be968cd743119

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

This PR includes changesets to release 1 package | Name | Type | | ----------------------------- | ----- | | @aws-amplify/backend-deployer | 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