-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: error messages are getting lost #1263
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mrgrain
commented
Aug 21, 2024
Comment on lines
+194
to
+208
} catch (e: unknown) { | ||
if (e instanceof utils.JsiiError) { | ||
if (e.showHelp) { | ||
console.log(); | ||
yargs.showHelp(); | ||
console.log(); | ||
} | ||
|
||
const LOG = log4js.getLogger(utils.CLI_LOGGER); | ||
LOG.error(e.message); | ||
|
||
process.exitCode = -1; | ||
} else { | ||
throw e; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff for this file is weird. This is the new part + the code above is now wrapped in a try-catch.
iliapolo
approved these changes
Aug 21, 2024
aws-cdk-automation
pushed a commit
that referenced
this pull request
Aug 21, 2024
All errors encountered jsii used to print in the following order: 1. Any logging output (might be empty) 2. Full CLI help 3. Actual error including stack trace This has a few downsides: - logging output is hidden from view due to long cli help - cli help is not useful in most cases - stack trace is not relevant to solving the error Instead we now print 1. Any logging output 2. CLI help only if explicitly requested by the error 3. Just the error message with a nice red prefix --- Also deletes some compiled js files that were incorrectly checked-in to the repo when it was migrated from `aws/jsii`. --- Previously: <img width="1167" alt="image" src="https://github.com/user-attachments/assets/2f44ae43-b1de-4883-a868-296968910dfa"> [...] <img width="1063" alt="image" src="https://github.com/user-attachments/assets/c460aeab-1e64-4ce1-afb0-5d6053c2f398"> Now: <img width="1174" alt="image" src="https://github.com/user-attachments/assets/37da4d64-dd2a-4b88-b7a0-fcbb8511baa3"> --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0 (cherry picked from commit 20e1570)
aws-cdk-automation
pushed a commit
that referenced
this pull request
Aug 21, 2024
All errors encountered jsii used to print in the following order: 1. Any logging output (might be empty) 2. Full CLI help 3. Actual error including stack trace This has a few downsides: - logging output is hidden from view due to long cli help - cli help is not useful in most cases - stack trace is not relevant to solving the error Instead we now print 1. Any logging output 2. CLI help only if explicitly requested by the error 3. Just the error message with a nice red prefix --- Also deletes some compiled js files that were incorrectly checked-in to the repo when it was migrated from `aws/jsii`. --- Previously: <img width="1167" alt="image" src="https://github.com/user-attachments/assets/2f44ae43-b1de-4883-a868-296968910dfa"> [...] <img width="1063" alt="image" src="https://github.com/user-attachments/assets/c460aeab-1e64-4ce1-afb0-5d6053c2f398"> Now: <img width="1174" alt="image" src="https://github.com/user-attachments/assets/37da4d64-dd2a-4b88-b7a0-fcbb8511baa3"> --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0 (cherry picked from commit 20e1570)
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
github-merge-queue bot
pushed a commit
that referenced
this pull request
Aug 21, 2024
# Backport This will backport the following commits from `main` to `maintenance/v5.3`: - [fix: error messages are getting lost (#1263)](#1263) <!--- Backport version: 9.5.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) Co-authored-by: Momo Kornher <kornherm@amazon.co.uk>
github-merge-queue bot
pushed a commit
that referenced
this pull request
Aug 21, 2024
# Backport This will backport the following commits from `main` to `maintenance/v5.4`: - [fix: error messages are getting lost (#1263)](#1263) <!--- Backport version: 9.5.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) Co-authored-by: Momo Kornher <kornherm@amazon.co.uk>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All errors encountered jsii used to print in the following order:
This has a few downsides:
Instead we now print
Also deletes some compiled js files that were incorrectly checked-in to the repo when it was migrated from
aws/jsii
.Previously:


[...]
Now:

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