Skip to content
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(cli): log error itself on unhandled rejection #6607

Merged
merged 1 commit into from
Feb 4, 2022
Merged

Conversation

Josh-Cena
Copy link
Collaborator

Motivation

See #6606. Since this rarely happens, it doens't hurt to log more. Errors themselves can be well-formatted in the console anyways.

Have you read the Contributing Guidelines on pull requests?

Yes

@Josh-Cena Josh-Cena added the pr: bug fix This PR fixes a bug in a past release. label Feb 4, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 4, 2022
@netlify
Copy link

netlify bot commented Feb 4, 2022

✔️ [V2]

🔨 Explore the source changes: 4521675

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61fd44e195d2cb00072f37fc

😎 Browse the preview: https://deploy-preview-6607--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Feb 4, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 88
🟢 Accessibility 100
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 92

Lighthouse ran on https://deploy-preview-6607--docusaurus-2.netlify.app/

@Josh-Cena Josh-Cena merged commit ed34a92 into main Feb 4, 2022
@Josh-Cena Josh-Cena deleted the jc/error-message branch February 4, 2022 15:33
@github-actions
Copy link

github-actions bot commented Feb 4, 2022

Size Change: 0 B

Total Size: 771 kB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 47.2 kB
website/build/assets/css/styles.********.css 105 kB
website/build/assets/js/main.********.js 582 kB
website/build/index.html 36.7 kB

compressed-size-action

@@ -254,6 +254,6 @@ async function run() {
run();

process.on('unhandledRejection', (err) => {
logger.error(err.stack);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have error.stack logged in multiple other places of the codebase, should we clean those up too?

Does it work correctly with toString/string interpolation logs?

Not sure why exactly, I think Node.js didn't log properly in older versions? 🤷‍♂️

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why either. Errors can both be stringified and logged very nicely. And yeah, I'll probably clean up the rest later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants