Files
vanillajs-seed/node_modules/try-catch
2019-04-15 16:18:31 +02:00
..
2019-04-15 11:34:09 +02:00
2019-04-15 11:34:09 +02:00
2019-04-15 11:34:09 +02:00
2019-04-15 16:18:31 +02:00
2019-04-15 11:34:09 +02:00

TryCatch

Try-catch wrapper.

Example

const tryCatch = require('tryCatch');
const {parse} = JSON;
const [error, result] = tryCatch(parse, 'hello');

if (error)
    console.error(error.message);

License

MIT