Skip to main content

ExceptionHandler example 1

Usage​

PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE(ExceptionHandler_) :: e
  • Instance of [[ExceptionHandler_]]
CHARACTER(LEN=*), PARAMETER :: modname = "ExceptionHandler_test_1.F90"
CHARACTER(LEN=*), PARAMETER :: myname = "main()"

Set quite mode off, [[ExceptionHandler_#SetQuiteMode]].

CALL e%setQuietMode(.FALSE.)
  • [[ExceptionHandler_#RaiseInformation]]
CALL e%raiseInformation(modName//"::"//myName//" - "// &
& 'Hello world')

Result:

[πŸ’š INFORMATION βœ…] [πŸš€ Module ] ExceptionHandler_test_1.F90 [πŸŽ‡ Method ] main() [πŸ”Š Message] Hello world

  • [[ExceptionHandler_#RaiseWarning]]
CALL e%raiseWarning(modName//"::"//myName//" - "// &
& 'Hello world')

[⚠ WARNING ❗] [πŸš€ Module ] ExceptionHandler_test_1.F90 [πŸŽ‡ Method ] main() [πŸ”Š Message] Hello world

  • [[ExceptionHandler_#RaiseDebug]]
CALL e%raiseDebug(modName//"::"//myName//" - "// &
& 'Hello world')

[❓ DEBUG πŸ›] [πŸš€ Module ] ExceptionHandler_test_1.F90 [πŸŽ‡ Method ] main() [πŸ”Š Message] Hello world

  • [[ExceptionHandler_#RaiseError]]
CALL e%raiseError(modName//"::"//myName//" - "// &
& 'Hello world')

[❎ ERROR β›”] [πŸš€ Module ] ExceptionHandler_test_1.F90 [πŸŽ‡ Method ] main() [πŸ”Š Message] Hello world

END PROGRAM main