error-object-polyfill

Replace your lame string errors with object versions.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
error-object-polyfill
201.2.2317 days ago5 years agoMinified + gzip package size for error-object-polyfill in KB

Readme

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');