Skip to content

API Host AuroraStackTrace

Liu.Yandong.Hanks edited this page Aug 21, 2026 · 3 revisions

AuroraStackTrace

Single script stack frame.

Namespace: AuroraScript.Runtime. Kind: class.

Back to .NET Host API Reference

Overview

AuroraStackTrace describes one frame of a script-level call stack: the script file, the method, and the line. Hosts normally read frames from AuroraRuntimeException.StackTrace rather than constructing them, but the constructor is public so a host can synthesize frames for its own error reporting.

Quick Reference

A minimal use of AuroraStackTrace.

var frame = new AuroraStackTrace(
    "scripts/main.as",
    "main",
    12);

Console.WriteLine(frame);

Constructors

AuroraStackTrace

AuroraStackTrace(string path, string method, int line)

Creates a script stack frame.

Parameters

Name Type Required Description
path string Yes Script path the frame belongs to.
method string Yes Script method name.
line int Yes Script line number.

Returns

A new AuroraStackTrace instance.

var frame = new AuroraStackTrace("scripts/main.as", "run", 12);

Fields

FileName

string FileName

File name portion of the frame path.

Parameters

None.

Returns

Returns string.

Console.WriteLine(frame.FileName);

FullPath

string FullPath

Full script path of the frame.

Parameters

None.

Returns

Returns string.

Console.WriteLine(frame.FullPath);

Method

string Method

Script method name of the frame.

Parameters

None.

Returns

Returns string.

Console.WriteLine(frame.Method);

Line

int Line

Script line number of the frame.

Parameters

None.

Returns

Returns int.

Console.WriteLine($"{frame.FileName}:{frame.Line}");

Methods

ToString

string ToString()

Formats the frame as a displayable stack line.

Parameters

None.

Returns

Returns string.

foreach (var frame in ex.StackTrace)
    Console.Error.WriteLine(frame.ToString());

Clone this wiki locally