error-object-polyfill

1.2.36 • 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

    589

    Version

    1.2.36

    License

    GPL-3.0

    Unpacked Size

    39.8 kB

    Total Files

    4

    Last publish

    Collaborators

    • wparad
    • rhosys