Interface IVBRaisableError
An error that can be raised at run time: one the runtime semantics layer reports, or one
workspace source raises for itself with Error or Err.Raise.
public interface IVBRaisableError
Remarks
The two are one thing to the interpreter — both interrupt the current activation, both reach the
session's Err object, and both may be caught by an On Error handler — and two things to
the editor, because RD-VBAL §2.6.3 gives them different diagnostic code families:
VBR for what the runtime semantics report, VBA for what the workspace raised. This is
what the interpreter's own error channel carries, so that the family travels with the error rather
than being decided by whatever static type a carrier happened to be declared as.
It deliberately does not admit a compile-time or syntax error. Those are VBErrorInfos too, but nothing raises one at run time, and a carrier that accepted one would be describing a state the interpreter has no handling for.
Properties
AsErrorInfo
This error as the diagnostic source metadata it is.
VBErrorInfo AsErrorInfo { get; }
Property Value
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.
Description
What went wrong, in words — Err.Description.
string Description { get; }
Property Value
ErrorId
The numeric error code — Err.Number, in source terms.
int ErrorId { get; }
Property Value
Location
The document location of whatever raised the error.
SourceLocation Location { get; }
Property Value
Verbose
A detailed message identifying the faulted node and detailing its semantics.
string Verbose { get; }
Property Value
Methods
ToDiagnosticCode()
The RD-VBAL §2.6.3 diagnostic code of this error, prefix and all.
string ToDiagnosticCode()
Returns
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.