option.js 377 B

12345678910111213141516171819
  1. module.exports = OptionError
  2. function OptionError(message, options) {
  3. var result = new Error()
  4. Object.defineProperty(result, "type", {
  5. value: result.type,
  6. enumerable: true,
  7. writable: true,
  8. configurable: true
  9. })
  10. result.option = options || null
  11. result.message = message
  12. result.type = "OptionError"
  13. return result
  14. }