Class AnException
Unit
classwork
Declaration
type AnException = class(APrintingObject)
Description
A basic exception.
This is the base class used by all exceptions in causerie. It provides methods for constructing and printing readable error messages to both stderr and instances of AStream.
Hierarchy
Overview
Fields
Methods
|
constructor because(errorCode: integer); |
|
constructor because(const msg: string); |
|
constructor because(errorCode: integer; const msg: string); |
|
constructor because(const msg: string; details: array of const); |
|
constructor because(errorCode: integer; const msg: string; details: array of const); |
|
function init: boolean; override; |
|
procedure print; |
|
function shallowCopyFrom(const Other: AnObject): boolean; override; |
|
function toString: string; override; |
|
function code: longword; |
|
function message: string; virtual; |
Description
Fields
|
myCode: longword; |
Stores the error code, if any, associated with the exception
|
Methods
|
constructor because(errorCode: integer); |
Constructs a new instance of AnException with the specified error code.
The error message stored by the new instance is set to errDefaultMessage.
|
|
constructor because(const msg: string); |
Constructs a new instance of AnException with the specified message.
The error code stored by the new instance is set to zero (0).
|
|
constructor because(errorCode: integer; const msg: string); |
Constructs a new instance of AnException with the specified error code and message.
|
|
constructor because(const msg: string; details: array of const); |
Constructs a new instance of AnException using the specified format string and details.
msg should be a format string that, when combined with the contents of details , will result in an error message that indicates the nature of the exception.
|
|
constructor because(errorCode: integer; const msg: string; details: array of const); |
Constructs a new instance of AnException using the specified error code, format string, and details.
msg should be a format string that, when combined with the contents of details , will result in an error message which indicates the nature of the exception.
|
|
function init: boolean; override; |
Initializer
|
|
procedure print; |
Writes the exception to stderr .
This method calls AnException.toString and prints the result of that call to stderr .
|
|
function shallowCopyFrom(const Other: AnObject): boolean; override; |
Construct a shallow copy of the other object.
This method overrides the behavior inherited from AnObject.shallowCopyFrom: it calls that method, then checks to see whether Other is an instance of AnException. If so, it copies the values of:
to Self from Other , overwriting any values in Self .
|
|
function toString: string; override; |
Constructs and returns a string representation of the exception, suitable for printing to a stream or display.
The base implementation of this method will construct a string that contains the error code, if any, as well as the error message associated with the exception. Descendant classes may override this method to produce different output.
|
|
function code: longword; |
Retrieves the error code associated with the exception.
|
|
function message: string; virtual; |
Retrieves the error message associated with the exception.
The base implementation of this method does NOT return the fully-formed string that is returned by AnException.toString; it simply returns the error message as defined during construction, or the default error message if none was provided when the instance was constructed.
|
Generated by PasDoc 0.13.0 on 2015-01-10 17:13:18
|