构造一个由于运行时可能发生的错误而引发的异常对象,例如内存不足、无法编译着色器等。如果函数可能引发此异常,则调用代码应准备好捕获它。 Constructs an exception object that is thrown due to an error that can occur at runtime, e.g., out of memory, could not compile shader, etc. If a function may throw this exception, the calling code should be prepared to catch it.
另一方面,一个 On the other hand, a
另一方面,一个 On the other hand, a
DeveloperError 表示由于开发人员错误而导致的异常,例如无效参数,通常表示调用代码中存在错误。 indicates an exception due to a developer error, e.g., invalid argument, that usually indicates a bug in the calling code.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
message |
string | 可选 optional 此异常的错误消息。 The error message for this exception. |
另见: See:
继承 Extends
- Error
成员 Members
抛出此异常的原因的解释。 The explanation for why this exception was thrown.
“RuntimeError”表示此异常是由于运行时错误而引发的。 'RuntimeError' indicating that this exception was thrown due to a runtime error.
此异常的堆栈跟踪(如果有)。 The stack trace of this exception, if available.
