An FTException object gives a way to pass generic information about an exceptional situation.
An FTException object gives a way to pass generic information about an exceptional situation. Methods for dealing with exceptions are defined in the SharedExceptionManagerModule module.
An FTException object wraps:
It is expected that classes will define exceptions that use instances of the FTException Class.
CALL e % initFTException(severity,exceptionName,infoDictionary)
Plus the convenience initializers, which automatically create a FTValueDictionary with a single key called "message":
CALL e % initWarningException(msg = "message")
CALL e % initFatalException(msg = "message")
Plus an assertion exception
CALL e % initAssertionFailureException(msg,expectedValueObject,observedValueObject,level)
CALL releaseFTException(e) [pointers]
CALL e % setInfoDictionary(infoDictionary)
dict => e % infoDictionary
name = e % exceptionName()
level = e % severity()
Severity levels are FT_ERROR_WARNING or FT_ERROR_FATAL
CALL e % printDescription()
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | parameter | :: | FT_ERROR_NONE | = | 0 | |
integer, | public, | parameter | :: | FT_ERROR_WARNING | = | 1 | |
integer, | public, | parameter | :: | FT_ERROR_FATAL | = | 2 | |
integer, | public, | parameter | :: | ERROR_MSG_STRING_LENGTH | = | 132 | |
character(len=21), | public, | parameter | :: | FTFatalErrorException | = | "FTFatalErrorException" | |
character(len=23), | public, | parameter | :: | FTWarningErrorException | = | "FTWarningErrorException" | |
character(len=27), | public, | parameter | :: | FTAssertionFailureException | = | "FTAssertionFailureException" |
Cast the base class FTObject to the FTException class
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTObject), | POINTER | :: | obj | |||
class(FTException), | POINTER | :: | cast |
final :: destructException |
procedure, public :: init => initFTObject | |
procedure, public :: description => FTObjectDescription | |
procedure, public, non_overridable :: copy => copyFTObject | |
procedure, public, non_overridable :: retain => retainFTObject | |
procedure, public, non_overridable :: isUnreferenced | |
procedure, public, non_overridable :: refCount | |
procedure, public :: initFTException | |
procedure, public :: initWarningException | |
procedure, public :: initFatalException | |
procedure, public :: initAssertionFailureException | |
procedure, public :: setInfoDictionary | |
procedure, public :: infoDictionary | |
procedure, public :: exceptionName | |
procedure, public :: severity | |
procedure, public :: printDescription => printFTExceptionDescription | |
procedure, public :: className => exceptionClassName |
Returns the exception's infoDictionary. Does not transfer ownership/reference count is unchanged.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTException) | :: | self |
Returns the string representing the name set for the exception.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTException) | :: | self |
Returns the severity level of the exception.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTException) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTObject), | POINTER | :: | obj |
Class name returns a string with the name of the type of the object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTException) | :: | self |
A convenience initializer for a warning error that includes the key "message" in the infoDictionary. Use this initializer as an example of how to write one's own exception.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTException) | :: | self | ||||
character(len=*) | :: | msg |
A convenience initializer for a fatal error that includes the key "message" in the infoDictionary.Use this initializer as an example of how to write one's own exception.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTException) | :: | self | ||||
character(len=*) | :: | msg |
The main initializer for the class
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTException) | :: | self | ||||
integer | :: | severity | ||||
character(len=*) | :: | exceptionName | ||||
class(FTDictionary), | optional, | POINTER | :: | infoDictionary |
A convenience initializer for an assertion error that includes the keys:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTException) | :: | self | ||||
character(len=*) | :: | msg | ||||
class(FTValue), | POINTER | :: | expectedValueObject | |||
class(FTValue), | POINTER | :: | ObservedValueObject | |||
integer | :: | level |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(FTException), | POINTER | :: | self |
The destructor for the class. Do not call this directly. Call the release() procedure instead
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(FTException) | :: | self |
Sets and retains the exception infoDictionary
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTException) | :: | self | ||||
class(FTDictionary), | POINTER | :: | dict |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTException) | :: | self |
A basic printing of the exception and the info held in the infoDictionary.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTException) | :: | self | ||||
integer | :: | iUnit |
Cast the base class FTObject to the FTException class
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTObject), | POINTER | :: | obj | |||
class(FTException), | POINTER | :: | cast |