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
-
objectEzrRuntimeError
- 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
stringThe title of the error.
details
stringDetails on why the error happened.
context
ContextThe context in which the error occurred.
startPosition
PositionThe starting position of the error.
endPosition
PositionThe 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
stringThe title of the error.
details
stringDetails on why the error happened.
wrapper
IEzrObjectThe caller.
executionContext
ContextThe 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
ErrorEndPosition
public Position ErrorEndPosition { get; }
Property Value
ErrorStartPosition
public Position ErrorStartPosition { get; }
Property Value
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
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime 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
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime 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
RuntimeResultRuntime 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
stringThe name of the argument.
ezrObject
IEzrObjectThe argument object.
context
ContextThe context of the argument.
result
RuntimeResultRuntime 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
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime 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
RuntimeResultRuntime 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
RuntimeResultRuntime result for carrying any errors.
Returns
- string
The evaluated value.