SharedExceptionManagerModule Module

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.

Initialization

    CALL initializeFTExceptions

Finalization

    CALL destructFTExceptions

Throwing an exception

     CALL throw(exception)

Getting the number of exceptions

     n = errorCount()

Getting the maximum exception severity

     s = maximumErrorSeverity()

Catching all exceptions

     IF(catch())     THEN
        Do something with the exceptions
     END IF

Getting the named exception caught

     CLASS(FTException), POINTER :: e
     e => errorObject()

Popping the top exception

     e => popLastException()

Peeking the top exception

     e => peekLastException()

Catching an exception with a given name

     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

Printing all exceptions

  call printAllExceptions

Uses

  • module~~sharedexceptionmanagermodule~~UsesGraph module~sharedexceptionmanagermodule SharedExceptionManagerModule module~ftexceptionclass FTExceptionClass module~sharedexceptionmanagermodule->module~ftexceptionclass module~ftdictionaryclass FTDictionaryClass module~ftexceptionclass->module~ftdictionaryclass module~ftlinkedlistiteratorclass FTLinkedListIteratorClass module~ftexceptionclass->module~ftlinkedlistiteratorclass module~ftstackclass FTStackClass module~ftexceptionclass->module~ftstackclass module~ftvaluedictionaryclass FTValueDictionaryClass module~ftexceptionclass->module~ftvaluedictionaryclass module~ftdictionaryclass->module~ftlinkedlistiteratorclass module~ftkeyobjectpairclass FTKeyObjectPairClass module~ftdictionaryclass->module~ftkeyobjectpairclass module~ftlinkedlistclass FTLinkedListClass module~ftdictionaryclass->module~ftlinkedlistclass module~ftmutableobjectarrayclass FTMutableObjectArrayClass module~ftdictionaryclass->module~ftmutableobjectarrayclass module~hashmodule HashModule module~ftdictionaryclass->module~hashmodule module~ftlinkedlistiteratorclass->module~ftlinkedlistclass module~ftstackclass->module~ftlinkedlistclass module~ftvaluedictionaryclass->module~ftdictionaryclass iso_fortran_env iso_fortran_env module~ftvaluedictionaryclass->iso_fortran_env module~ftvalueclass FTValueClass module~ftvaluedictionaryclass->module~ftvalueclass module~ftobjectclass FTObjectClass module~ftkeyobjectpairclass->module~ftobjectclass module~ftlinkedlistclass->module~ftmutableobjectarrayclass module~ftlinkedlistrecordclass FTLinkedListRecordClass module~ftlinkedlistclass->module~ftlinkedlistrecordclass module~ftmutableobjectarrayclass->module~ftobjectclass module~ftvalueclass->iso_fortran_env ieee_arithmetic ieee_arithmetic module~ftvalueclass->ieee_arithmetic module~ftvalueclass->module~ftobjectclass module~ftolconstants FTOLConstants module~ftvalueclass->module~ftolconstants module~ftlinkedlistrecordclass->module~ftobjectclass

Interfaces

public interface catch

  • private function catchAll()

    Returns .TRUE. if there are any exceptions.

    Arguments

    None

    Return Value logical

  • private function catchErrorWithName(exceptionName)

    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.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*) :: exceptionName

    Return Value logical


Functions

public function errorCount()

Returns the number of exceptions that have been thrown.

Arguments

None

Return Value integer

public function maximumErrorSeverity()

Returns the maxSeverity of exceptions that have been thrown.

Arguments

None

Return Value integer

public function errorObject()

Returns a pointer to the current exception.

Arguments

None

Return Value class(FTException), POINTER

public function popLastException()

Get the last exception posted. This is popped from the stack. The caller is responsible for releasing the object after popping

Arguments

None

Return Value class(FTException), POINTER

public function peekLastException()

Get the last exception posted. This is NOT popped from the stack. The caller does not own the object.

Arguments

None

Return Value class(FTException), POINTER


Subroutines

public subroutine initializeFTExceptions()

Called at start of execution. Will be called automatically if an exception is thrown.

Arguments

None

public subroutine destructFTExceptions()

Called at the end of execution. This procedure will announce if there are uncaught exceptions raised and print them.

Arguments

None

public subroutine throw(exceptionToThrow)

Throws the exception: exceptionToThrow

Arguments

Type IntentOptional Attributes Name
type(FTException), POINTER :: exceptionToThrow

public subroutine setCurrentError(e)

Arguments

Type IntentOptional Attributes Name
class(FTException), POINTER :: e

public subroutine printAllExceptions()

Arguments

None

public subroutine releaseCurrentError()

Arguments

None