Table of Contents

Class VBRuntimeErrorInfo

Namespace
RDCore.SDK.Model.Errors
Assembly
RDCore.SDK.dll

Encapsulates the serializable error data for a runtime error.

public record VBRuntimeErrorInfo : VBErrorInfo, IEquatable<VBErrorInfo>, IVBRaisableError, IEquatable<VBRuntimeErrorInfo>
Inheritance
VBRuntimeErrorInfo
Implements
Inherited Members

Remarks

A runtime error occurs while traversing the abstract syntax tree (AST) in the RDCore runtime.

Constructors

VBRuntimeErrorInfo(int, SourceLocation, string, string)

Encapsulates the serializable error data for a runtime error.

public VBRuntimeErrorInfo(int ErrorId, SourceLocation Location, string Description, string Verbose)

Parameters

ErrorId int

The number of the error: Err.Number, and the number of its VBR diagnostic code.

Location SourceLocation

The document location of the problematic node.

Description string

What the error is: Err.Description.

Verbose string

A detailed message that is optionally appended, depending on the current server trace configuration.

Remarks

A runtime error occurs while traversing the abstract syntax tree (AST) in the RDCore runtime.

Properties

AsErrorInfo

This error as the diagnostic source metadata it is.

public VBErrorInfo AsErrorInfo { get; }

Property Value

VBErrorInfo

Remarks

Every raisable error is a VBErrorInfo: that is the constraint C# has no way to state on an interface, so it is stated here instead, and implemented as this. It is what lets a carrier hold the interface, keeping the diagnostic family with the error, and still hand the error to the diagnostics pipeline, which is generic over the record rather than over this.

IsDecidedByTypes

Whether the error is raised whatever values the operation is given: decided by their types alone - a Byte() let-coerced to a Long is a type mismatch, whatever bytes it holds (MS-VBAL 5.5.1.2.6).

public bool IsDecidedByTypes { get; init; }

Property Value

bool

Remarks

An analysis evaluates code with values it assumes, and states none of the errors those raise: what an assumed value raises is not known to happen. An error decided by the types is, which is why it is stated all the same - the evaluation of an operation on a value that is not known keeps it, and an instruction whose evaluation assumed something reports it.

Methods

ToDiagnosticCode()

The RD-VBAL §2.6.3 diagnostic code of this error, prefix and all.

public string ToDiagnosticCode()

Returns

string

Remarks

👉 A member rather than an extension, deliberately. An extension binds to the static type of what it is called on, so an application error held in a variable declared as anything more general would silently report the wrong family, which is exactly how an error travels through the interpreter.