All exceptions are posted to the SharedExceptionManagerModule.
To use exceptions,first initialize it CALL initializeFTExceptions From that point on, all exceptions will be posted there. Note that the FTTestSuiteManager class will initialize the SharedExceptionManagerModule, so there is no need to do the initialization separately if the FTTestSuiteManager class has been initialized.
The exceptions are posted to a stack. To access the exceptions they will be peeked or popped from that stack.
CALL initializeFTExceptions
CALL destructFTExceptions
CALL throw(exception)
n = errorCount()
IF(catch()) THEN
Do something with the exceptions
END IF
CLASS(FTException), POINTER :: e
e => errorObject()
e => popLastException()
e => peekLastException()
IF(catch(name)) THEN
!Do something with the exception, e.g.
e => errorObject()
d => e % infoDictionary()
userDictionary => valueDictionaryFromDictionary(dict = d)
msg = userDictionary % stringValueForKey("message",FTDICT_KWD_STRING_LENGTH)
END IF
call printAllExceptions
Returns .TRUE. if there are any exceptions.
Returns .TRUE. if there is an exception with the requested name. If so, it pops the exception and saves the pointer to it so that it can be accessed with the currentError() function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*) | :: | exceptionName |
Returns the number of exceptions that have been thrown.
Get the last exception posted. This is popped from the stack. The caller is responsible for releasing the object after popping
Get the last exception posted. This is NOT popped from the stack. The caller does not own the object.
Called at start of execution. Will be called automatically if an exception is thrown.
Called at the end of execution. This procedure will announce if there are uncaught exceptions raised and print them.
Throws the exception: exceptionToThrow
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTException), | POINTER | :: | exceptionToThrow |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(FTException), | POINTER | :: | e |