go-for-it
Error handling à la golang.
Read the blog post:
Installation
npm install go-for-it
Example
const go = const toUpper = async { if string === 'invalid' throw Error'Invalid input' return string}const errorHandler = { console }const print = consolelog const foo = async { const err value = await if err return } // Works normally.// "GUNAR" // Business Logic Error gets handled by errorHandler().// "There has been an error. I'll handle it." // Runtime Exceptions DO NOT get handled by errorHandler(),