const tryCatchWrapper = (executable) => async (...args) => { try { const result = await executable(...args); return result; } catch (error) { // use any custom handler here error.message = `[${executable.name}] - ${error.message}`; error.data = {...error.data, input_args: args} throw error; } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter