Catch Async
Utility used to wrap root async functions to avoid uncaught promise errors to go silent.
catchAsync is intented for use in the root-level of an asyncronous chain of
functions, basically avoiding the need of using try/catch
and risking to leave silent errors in code.
API Documentation
Table of Contents
catchAsync
Returns an async function wrapped in a try catch function. It will by default log any error thrown in the async function unless a handleError function is provided. In that case it will instead call handleError
Parameters
Returns Function Wrapped async function