DEV Community

ehmicky
ehmicky

Posted on

2 1

Show some đź–¤ to Node.js process errors

Node.js prints process errors (uncaughtException, warning, unhandledRejection, rejectionHandled) on the console which is very useful. Unfortunately those errors:

  • do not show stack traces for warning and rejectionHandled making them hard to debug.
  • do not include multipleResolves errors (when a promise is resolved/rejected twice).
  • are inconvenient to log to an external service.
  • are hard to test.
  • cannot be conditionally skipped.
  • are printed each time an error is repeated (except for warning).
  • are not human-friendly.

I have created a library that fixes all those issues: log-process-errors.

Feel free to check it out at https://github.com/ehmicky/log-process-errors. Any feedback is welcome!

SurveyJS custom survey software

Simplify data collection in your JS app with a fully integrated form management platform. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more. Integrates with any backend system, giving you full control over your data and no user limits.

Learn more

Top comments (0)

SurveyJS custom survey software

Build Your Own Forms without Manual Coding

SurveyJS UI libraries let you build a JSON-based form management system that integrates with any backend, giving you full control over your data with no user limits. Includes support for custom question types, skip logic, an integrated CSS editor, PDF export, real-time analytics, and more.

Learn more

đź‘‹ Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay