Solve the try-catch hell using golang style error handling.
npm i @klipitkas/await-to --save
import { to } from 'await-to';
const doSomething = () => {
const [ data, error ] = await to(resolveOrRejectSomePromise());
if (error) {
throw new Error("Whoops!");
}
return data;
}
npm run test