pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/airbnb/javascript/pull/3245

ssorigen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-70be7debc79a8eff.css" /> fix: handle unhandled promise rejections in whitespace-async.js by sinteticx · Pull Request #3245 · airbnb/javascript · GitHub
Skip to content

fix: handle unhandled promise rejections in whitespace-async.js#3245

Open
sinteticx wants to merge 3 commits into
airbnb:masterfrom
sinteticx:fix-#3237
Open

fix: handle unhandled promise rejections in whitespace-async.js#3245
sinteticx wants to merge 3 commits into
airbnb:masterfrom
sinteticx:fix-#3237

Conversation

@sinteticx

Copy link
Copy Markdown

Add .catch() handlers to promise chains in whitespace-async.js files to prevent unhandled rejections and provide clear error messages.

Summary

Fix unhandled promise rejections in whitespace-async.js scripts that occur when ESLint 9 loads the config or when CLIEngine is unavailable.

Problem

The onlyErrorOnRules(...).then(...) promise chain lacked a .catch() handler. If the promise rejects, it causes an unhandled rejection, potentially crashing the process. Additionally, child process errors or non-JSON output could cause JSON.parse(stdout) to fail with unclear errors during config loading.

Solution

Added .catch() handlers to log errors to stderr and exit with code 1, ensuring graceful failure and better error visibility.

Files Changed

  • packages/eslint-config-airbnb-base/whitespace-async.js
  • packages/eslint-config-airbnb/whitespace-async.js

Testing

Verified scripts run without unhandled rejections in both packages.

Add .catch() handlers to promise chains in whitespace-async.js files
to prevent unhandled rejections and provide clear error messages.
@sinteticx

Copy link
Copy Markdown
Author

Hi @sagmor pls review my changes

daltino

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy