-
Notifications
You must be signed in to change notification settings - Fork 0
API Host ScriptError
通过运行时异常和脚本值公开的脚本级错误对象。
Script-level error object exposed through runtime exceptions and script values.
命名空间:AuroraScript.Runtime.Types。类型:class。
Namespace:
AuroraScript.Runtime.Types. Kind: class.
Purpose
ScriptError 是公开宿主类型。通过下方签名选择调用方式;对运行时对象、生命周期和异常,应由宿主在边界处明确处理。
Script-level error object exposed through runtime exceptions and script values.
Simple Example
下面是 ScriptError 的最小使用方式。
A minimal use of
ScriptError.
// ScriptError 由脚本的 Error 构造器创建,并通过运行时异常携带。
@module(MAIN);
export func run() {
throw new Error("invalid input");
}Members
读取 Message 属性。
Use the member according to its public signature.
Parameters:
- 无。
None.
Returns
返回 string。
Returns
string.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptError value = /* 从宿主 API 获取实例 */;
var current = value.Message;读取 StackTrace 属性。
Use the member according to its public signature.
Parameters:
- 无。
None.
Returns
返回 AuroraStackTrace[]。
Returns
AuroraStackTrace[].
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptError value = /* 从宿主 API 获取实例 */;
var current = value.StackTrace;AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License