Skip to content

API Host AuroraRuntimeException

Liu.Yandong.Hanks edited this page Aug 19, 2026 · 2 revisions

AuroraRuntimeException

携带脚本级调用栈信息的运行时异常。

Runtime exception with script-level stack trace information.

命名空间:AuroraScript。类型:class。

Namespace: AuroraScript. Kind: class.

返回 .NET Host API 参考

Back to .NET Host API Reference

用途

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

Constructor

签名

  • 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 Exception parameter required by the signature.

  • stackTrace
    按签名提供的 IReadOnlyList<AuroraStackTrace> 参数。

    The IReadOnlyList<AuroraStackTrace> parameter required by the signature.

  • message
    按签名提供的 string 参数。

    The string parameter required by the signature.

  • error
    按签名提供的 ScriptError 参数。

    The ScriptError parameter required by the signature.

Returns

新建的 AuroraRuntimeException 实例。

A new AuroraRuntimeException instance.

调用示意

以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。

The example shows the call shape; replace placeholder instances and arguments with actual host values.

var value = new AuroraRuntimeException(/* 参数 */);

string ModuleName

读取 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;

int LineNumber

读取 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;

IReadOnlyList<AuroraStackTrace> StackTrace

读取 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;

string ToString()

调用 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();

Clone this wiki locally