1.0.5 • Published 7 years ago

error-object v1.0.5

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

Custom errors

Error

var errorObject = require("error-object")

function doSomethingBad() {
  throw new errorObject('It went bad!', {
    errorCode: 1,
    foo: "bar",
    obj: {

    },
    // ...
  });
}

try {
  doSomethingBad()
} catch (e) {
  console.error(err.message);
  console.error(err.extra.errorCode);
  console.error(err.extra.foo);
  console.error(err.extra.obj);
} finally {

}
1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago