🔨defineWrapConfig
Set Panic By Default
By default, when a user trying to unwrap
a wrapped function, unwrapit
will throw an error no matter in a browser or in Node.js. However, you may want the Node program to exit when an error occurs.
One way is that you can use the {panic: true}
option
If you want the program to exit by default, then can set the panic by default
Customize Panic Function
Sometimes, you may want to have a central place to handle all the errors, you can set your do this simply by providing your own panic function which conforms to the below signature.
Here's an example
Last updated