Error 类


通用的 JavaScript <Error> 对象,不表明错误发生的具体情况。 Error 对象会捕获堆栈跟踪,详细说明实例化 Error 的代码点,并可能提供错误的文本描述。

Node.js 产生的所有错误(包括所有的系统错误和 JavaScript 错误),都实例化自或继承自 Error 类。

A generic JavaScript <Error> object that does not denote any specific circumstance of why the error occurred. Error objects capture a "stack trace" detailing the point in the code at which the Error was instantiated, and may provide a text description of the error.

All errors generated by Node.js, including all System and JavaScript errors, will either be instances of, or inherit from, the Error class.