Table of Contents

Class EzrRuntimeError

Namespace
EzrSquared.Runtime.Types.Core.Errors
Assembly
ezrSquared-lib.dll

Implementation of IEzrRuntimeError with some utility methods.

[WrapMember("runtime_error", false, false)]
public class EzrRuntimeError : EzrObject, IEzrRuntimeError, IEzrObject, IEzrError
Inheritance
object
EzrRuntimeError
Implements
Derived
Inherited Members

Constructors

EzrRuntimeError(string, string, Context, Position, Position)

Creates a new runtime error object.

public EzrRuntimeError(string title, string details, Context context, Position startPosition, Position endPosition)

Parameters

title string

The title of the error.

details string

Details on why the error happened.

context Context

The context in which the error occurred.

startPosition Position

The starting position of the error.

endPosition Position

The ending position of the error.

EzrRuntimeError(string, string, IEzrObject, Context)

Wrapper constructor for creating the error object.

[WrapMember(false, false)]
public EzrRuntimeError(string title, string details, IEzrObject wrapper, Context executionContext)

Parameters

title string

The title of the error.

details string

Details on why the error happened.

wrapper IEzrObject

The caller.

executionContext Context

The execution context.

Properties

Details

The reason why the IEzrError occurred.

public string Details { get; }

Property Value

string

ErrorContext

The context where the error occurred.

public Context ErrorContext { get; }

Property Value

Context

ErrorEndPosition

The ending Position of the IEzrError.

public Position ErrorEndPosition { get; }

Property Value

Position

ErrorStartPosition

The starting Position of the IEzrError.

public Position ErrorStartPosition { get; }

Property Value

Position

Tag

The tag of the type of this object, similar to C# namespace naming conventions.

public override string Tag { get; protected internal set; }

Property Value

string

Title

The name of the IEzrError.

public string Title { get; }

Property Value

string

TypeName

The name of the type of this object, in plain text, all lowercase. Spaces are allowed.

public override string TypeName { get; protected internal set; }

Property Value

string

Methods

ComparisonEqual(IEzrObject, RuntimeResult)

Compares the object to another, checks equality.

public override void ComparisonEqual(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying the result and any errors.

ComparisonNotEqual(IEzrObject, RuntimeResult)

Compares the object to another, checks unequality.

public override void ComparisonNotEqual(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying the result and any errors.

ComputeHashCode(RuntimeResult)

Evaluates the current object as its hash.

public override int ComputeHashCode(RuntimeResult result)

Parameters

result RuntimeResult

Runtime result for carrying any errors.

Returns

int

The evaluated value.

GenerateTraceback(int)

Generates the trace back to the error.

protected internal string GenerateTraceback(int correctedLineNumber)

Parameters

correctedLineNumber int

Returns

string

The trace.

GetStringArgument(string, IEzrObject, Context, RuntimeResult)

Converts the given argument to a string.

protected internal static string GetStringArgument(string argumentName, IEzrObject ezrObject, Context context, RuntimeResult result)

Parameters

argumentName string

The name of the argument.

ezrObject IEzrObject

The argument object.

context Context

The context of the argument.

result RuntimeResult

Runtime result for carrying any errors.

Returns

string

The string, or string.Empty if failed.

StrictEquals(IEzrObject, RuntimeResult)

Strictly compares the current object to another, taking into account inheritance.

public override bool StrictEquals(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying any errors.

Returns

bool

ToPureString(RuntimeResult)

Evaluates the current object as a string value.

public override string ToPureString(RuntimeResult result)

Parameters

result RuntimeResult

Runtime result for carrying any errors.

Returns

string

The evaluated value.

Remarks

This is used to show the 'real' string representation of the object. Like, for example, ToString(RuntimeResult) will
return "example" when called on an EzrString object with value "example", but this function will return example (without quotes).

ToString(RuntimeResult)

Evaluates the current object as a string value.

public override string ToString(RuntimeResult result)

Parameters

result RuntimeResult

Runtime result for carrying any errors.

Returns

string

The evaluated value.