-
Notifications
You must be signed in to change notification settings - Fork 0
API Host AuroraRuntimeException
携带脚本级调用栈信息的运行时异常。
Runtime exception with script-level stack trace information.
命名空间:AuroraScript。类型:class。
Namespace:
AuroraScript. Kind: class.
Purpose
AuroraRuntimeException 是公开宿主类型。通过下方签名选择调用方式;对运行时对象、生命周期和异常,应由宿主在边界处明确处理。
Runtime exception with script-level stack trace information.
Simple Example
下面是 AuroraRuntimeException 的最小使用方式。
A minimal use of
AuroraRuntimeException.
try
{
domain.Execute("MAIN", "run");
}
catch (AuroraRuntimeException ex)
{
Console.Error.WriteLine($"{ex.ModuleName}:{ex.LineNumber}");
}Members
签名
AuroraRuntimeException(Exception ex, IReadOnlyList<AuroraStackTrace> stackTrace)AuroraRuntimeException(string message)AuroraRuntimeException(ScriptError error)
创建 AuroraRuntimeException 实例。
Use the member according to its public signature.
Parameters:
-
ex
按签名提供的Exception参数。The
Exceptionparameter required by the signature. -
stackTrace
按签名提供的IReadOnlyList<AuroraStackTrace>参数。The
IReadOnlyList<AuroraStackTrace>parameter required by the signature. -
message
按签名提供的string参数。The
stringparameter required by the signature. -
error
按签名提供的ScriptError参数。The
ScriptErrorparameter required by the signature.
Returns
新建的 AuroraRuntimeException 实例。
A new
AuroraRuntimeExceptioninstance.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
var value = new AuroraRuntimeException(/* 参数 */);读取 ModuleName 字段。
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.
AuroraRuntimeException value = /* 从宿主 API 获取实例 */;
var current = value.ModuleName;读取 LineNumber 字段。
Use the member according to its public signature.
Parameters:
- 无。
None.
Returns
返回 int。
Returns
int.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
AuroraRuntimeException value = /* 从宿主 API 获取实例 */;
var current = value.LineNumber;读取 StackTrace 字段。
Use the member according to its public signature.
Parameters:
- 无。
None.
Returns
返回 IReadOnlyList<AuroraStackTrace>。
Returns
IReadOnlyList<AuroraStackTrace>.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
AuroraRuntimeException value = /* 从宿主 API 获取实例 */;
var current = value.StackTrace;调用 ToString 完成其公开操作。
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.
AuroraRuntimeException value = /* 从宿主 API 获取实例 */;
var result = value.ToString();AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License