错误对象的补充


每当 Error 对象通过域路由时,都会向其中添加一些额外的字段。

  • error.domain 最先处理错误的域。
  • error.domainEmitter 触发带有错误对象的 'error' 事件的事件触发器。
  • error.domainBound 绑定到域的回调函数,并且传入一个错误作为其第一个参数。
  • error.domainThrown 布尔值,指示错误是被抛出、触发、还是传给绑定的回调函数。

Any time an Error object is routed through a domain, a few extra fields are added to it.

  • error.domain The domain that first handled the error.
  • error.domainEmitter The event emitter that emitted an 'error' event with the error object.
  • error.domainBound The callback function which was bound to the domain, and passed an error as its first argument.
  • error.domainThrown A boolean indicating whether the error was thrown, emitted, or passed to a bound callback function.