error-object-polyfill
TypeScript icon, indicating that this package has built-in type declarations

1.2.44 • Public • Published

error-object-polyfill.js

Replace your lame string errors with object versions.

Usage

Use Error.create to pass objects as error messages. That's it, really simple, one line error objects, go to town!

throw Error.create({ title: 'Message', details: { data: {} } }, 'OPTIONAL_ERROR_CODE');

/error-object-polyfill/

    Package Sidebar

    Install

    npm i error-object-polyfill

    Weekly Downloads

    825

    Version

    1.2.44

    License

    GPL-3.0

    Unpacked Size

    40 kB

    Total Files

    5

    Last publish

    Collaborators

    • wparad
    • rhosys