Wraps a function to catch and re-throw any errors it throws out of the current execution flow.
This prevents unhandled exceptions from disrupting the current execution flow.
Note: This function does not handle promise rejections. For async functions, use noThrowAsync instead.
noThrowAsync
The function to wrap.
A new function that wraps the original function and catches any errors thrown.
Wraps a function to catch and re-throw any errors it throws out of the current execution flow.
This prevents unhandled exceptions from disrupting the current execution flow.
Note: This function does not handle promise rejections. For async functions, use
noThrowAsync
instead.