ferror 1.4.1
FERROR is a library to assist with error handling in Fortran projects.
All Classes Namespaces Files Functions Variables Typedefs Pages
ferror::errors Type Reference

Defines a type for managing errors and warnings. More...

Public Member Functions

procedure, public get_log_filename => er_get_log_filename
 Gets the name of the error log file. More...
 
procedure, public set_log_filename => er_set_log_filename
 Sets the name of the error log file. More...
 
procedure, public report_error => er_report_error
 Reports an error condition to the user. More...
 
procedure, public report_warning => er_report_warning
 Reports a warning message to the user. More...
 
procedure, public log_error => er_log_error
 brief Writes an error log file. More...
 
procedure, public has_error_occurred => er_has_error_occurred
 Tests to see if an error has been encountered. More...
 
procedure, public reset_error_status => er_reset_error_status
 Resets the error status flag to false, and the current error flag to zero. More...
 
procedure, public has_warning_occurred => er_has_warning_occurred
 Tests to see if a warning has been encountered. More...
 
procedure, public reset_warning_status => er_reset_warning_status
 Resets the warning status flag to false, and the current warning flag to zero. More...
 
procedure, public get_error_flag => er_get_error_flag
 Gets the current error flag. More...
 
procedure, public get_warning_flag => er_get_warning_flag
 Gets the current warning flag. More...
 
procedure, public get_exit_on_error => er_get_exit_on_error
 Gets a logical value determining if the application should be terminated when an error is encountered. More...
 
procedure, public set_exit_on_error => er_set_exit_on_error
 Sets a logical value determining if the application should be terminated when an error is encountered. More...
 
procedure, public get_suppress_printing => er_get_suppress_printing
 Gets a logical value determining if printing of error and warning messages should be suppressed. More...
 
procedure, public set_suppress_printing => er_set_suppress_printing
 Sets a logical value determining if printing of error and warning messages should be suppressed. More...
 
procedure, public get_error_message => er_get_err_msg
 Gets the current error message. More...
 
procedure, public get_warning_message => er_get_warning_msg
 Gets the current warning message. More...
 
procedure, public get_error_fcn_name => er_get_err_fcn
 Gets the name of the routine that initiated the error. More...
 
procedure, public get_warning_fcn_name => er_get_warning_fcn
 Gets the name of the routine that initiated the warning. More...
 
procedure, public get_clean_up_routine => er_get_err_fcn_ptr
 Gets the routine to call when an error has been logged. More...
 
procedure, public set_clean_up_routine => er_set_err_fcn_ptr
 Sets the routine to call when an error has been logged. More...
 

Detailed Description

Defines a type for managing errors and warnings.

Definition at line 99 of file ferror.f90.

Member Function/Subroutine Documentation

◆ get_clean_up_routine()

procedure, public ferror::errors::get_clean_up_routine

Gets the routine to call when an error has been logged.

Syntax
subroutine get_clean_up_routine(class(errors) this, procedure(error_callback) pointer ptr)
Parameters
[in]thisThe errors object.
[out]ptrA pointer to the error_callback routine.

Definition at line 358 of file ferror.f90.

◆ get_error_fcn_name()

procedure, public ferror::errors::get_error_fcn_name

Gets the name of the routine that initiated the error.

Syntax
character(len = :) function get_error_fcn_name(class(errors) this)
Parameters
[in]thisThe errors object.
Returns
The routine or function name.

Definition at line 336 of file ferror.f90.

◆ get_error_flag()

procedure, public ferror::errors::get_error_flag

Gets the current error flag.

Syntax
integer(int32) function get_error_flag(class(errors) this)
int get_error_flag(const error_handler *err)
Gets the current error flag.
Parameters
[in]thisThe errors object.
Returns
The current error flag.

Definition at line 240 of file ferror.f90.

◆ get_error_message()

procedure, public ferror::errors::get_error_message

Gets the current error message.

Syntax
character(len = :) function get_error_message(class(errors) this)
Parameters
[in]thisThe errors object.
Returns
The error message.

Definition at line 314 of file ferror.f90.

◆ get_exit_on_error()

procedure, public ferror::errors::get_exit_on_error

Gets a logical value determining if the application should be terminated when an error is encountered.

Syntax
logical function get_exit_on_error(class(errors) this)
bool get_exit_on_error(const error_handler *err)
Gets a logical value determining if the application should be terminated when an error is encountered...
Parameters
[in]thisThe errors object.
Returns
Returns true if the application should be terminated; else, false.

Definition at line 264 of file ferror.f90.

◆ get_log_filename()

procedure, public ferror::errors::get_log_filename

Gets the name of the error log file.

Syntax
character(len = :) function get_log_filename(class(errors) this, )
Parameters
[in]thisThe errors object.
Returns
The filename.

Definition at line 122 of file ferror.f90.

◆ get_suppress_printing()

procedure, public ferror::errors::get_suppress_printing

Gets a logical value determining if printing of error and warning messages should be suppressed.

Syntax
logical function get_suppress_printing(class(errors) err)
bool get_suppress_printing(const error_handler *err)
Gets a logical value determining if printing of error and warning messages should be suppressed.
Parameters
[in]thisThe errors object.
Returns
True if message printing should be suppressed; else, false to allow printing.

Definition at line 290 of file ferror.f90.

◆ get_warning_fcn_name()

procedure, public ferror::errors::get_warning_fcn_name

Gets the name of the routine that initiated the warning.

Syntax
character(len = :) function get_warning_fcn_name(class(errors) this)
Parameters
[in]thisThe errors object.
Returns
The routine or function name.

Definition at line 347 of file ferror.f90.

◆ get_warning_flag()

procedure, public ferror::errors::get_warning_flag

Gets the current warning flag.

Syntax
integer(int32) function get_warning_flag(class(errors) this)
int get_warning_flag(const error_handler *err)
Gets the current warning flag.
Parameters
[in]thisThe errors object.
Returns
The current warning flag.

Definition at line 251 of file ferror.f90.

◆ get_warning_message()

procedure, public ferror::errors::get_warning_message

Gets the current warning message.

Syntax
character(len = :) function get_warning_message(class(errors) this)
Parameters
[in]thisThe errors object.
Returns
The warning message.

Definition at line 325 of file ferror.f90.

◆ has_error_occurred()

procedure, public ferror::errors::has_error_occurred

Tests to see if an error has been encountered.

Syntax
logical function has_error_occurred(class(errors) this)
bool has_error_occurred(const error_handler *err)
Tests to see if an error has been encountered.
Parameters
[in]thisThe errors object.
Returns
Returns true if an error has been encountered; else, false.

Definition at line 196 of file ferror.f90.

◆ has_warning_occurred()

procedure, public ferror::errors::has_warning_occurred

Tests to see if a warning has been encountered.

Syntax
logical function has_warning_occurred(class(errors) this)
bool has_warning_occurred(const error_handler *err)
Tests to see if a warning has been encountered.
Parameters
[in]thisThe errors object.
Returns
Returns true if a warning has been encountered; else, false.

Definition at line 218 of file ferror.f90.

◆ log_error()

procedure, public ferror::errors::log_error

brief Writes an error log file.

Syntax
subroutine log_error(class(errors) this, character(len = *) fcn, character(len = *) msg, integer(int32) flag)
void log_error(const error_handler *err, const char *fcn, const char *msg, int flag)
Writes an error log file.
Parameters
[in]thisThe errors object.
[in]fcnThe name of the function or subroutine in which the error was encountered.
[in]msgThe error message.
[in]flagThe error flag.

Definition at line 185 of file ferror.f90.

◆ report_error()

procedure, public ferror::errors::report_error

Reports an error condition to the user.

Syntax
subroutine report_error(class(errors) this, character(len = *) msg, integer(int32) flag, optional class(*) obj)
void report_error(error_handler *err, const char *fcn, const char *msg, int flag)
Reports an error condition to the user.
Parameters
[in,out]thisThe errors object.
[in]fcnThe name of the function or subroutine in which the error was encountered.
[in]msgThe error message.
[in]flagThe error flag.
[in,out]objAn optional unlimited polymorphic object that can be passed to provide information to the clean-up routine.
Remarks
The default behavior prints an error message, appends the supplied information to a log file, and terminates the program.

Definition at line 153 of file ferror.f90.

◆ report_warning()

procedure, public ferror::errors::report_warning

Reports a warning message to the user.

Syntax
subroutine report_warning(class(errors) this, character(len = *) msg, integer(int32) flag)
void report_warning(error_handler *err, const char *fcn, const char *msg, int flag)
Reports a warning condition to the user.
Parameters
[in,out]thisThe errors object.
[in]fcnThe name of the function or subroutine from which the warning was issued.
[in]msgThe warning message.
[in]flagThe warning flag.
Remarks
The default behavior prints the warning message, and returns control back to the calling code.

Definition at line 171 of file ferror.f90.

◆ reset_error_status()

procedure, public ferror::errors::reset_error_status

Resets the error status flag to false, and the current error flag to zero.

Syntax
subroutine reset_error_status(class(errors) this)
void reset_error_status(error_handler *err)
Resets the error status flag to false, and the current error flag to zero.
Parameters
[in,out]thisThe errors object.

Definition at line 207 of file ferror.f90.

◆ reset_warning_status()

procedure, public ferror::errors::reset_warning_status

Resets the warning status flag to false, and the current warning flag to zero.

Syntax
subroutine reset_warning_status(class(errors) this)
void reset_warning_status(error_handler *err)
Resets the warning status flag to false, and the current warning flag to zero.
Parameters
[in,out]thisThe errors object.

Definition at line 229 of file ferror.f90.

◆ set_clean_up_routine()

procedure, public ferror::errors::set_clean_up_routine

Sets the routine to call when an error has been logged.

Syntax
subroutine set_clean_up_routine(class(errors) this, procedure(error_callback) pointer ptr)
Parameters
[in,out]thisThe errors object.
[in]ptrA pointer to the error_callback routine.

Definition at line 369 of file ferror.f90.

◆ set_exit_on_error()

procedure, public ferror::errors::set_exit_on_error

Sets a logical value determining if the application should be terminated when an error is encountered.

Syntax
subroutine set_exit_on_error(class(errors) this, logical x)
void set_exit_on_error(error_handler *err, bool x)
Sets a logical value determining if the application should be terminated when an error is encountered...
Parameters
[in,out]thisThe errors object.
[in]xSet to true if the application should be terminated when an error is reported; else, false.

Definition at line 277 of file ferror.f90.

◆ set_log_filename()

procedure, public ferror::errors::set_log_filename

Sets the name of the error log file.

Syntax
subroutine set_log_filename(class(errors) this, character(len = *) str)
void set_log_filename(error_handler *err, const char *fname)
Sets the error log filename.
Parameters
[in,out]thisThe errors object.
[in]strThe filename.

Definition at line 133 of file ferror.f90.

◆ set_suppress_printing()

procedure, public ferror::errors::set_suppress_printing

Sets a logical value determining if printing of error and warning messages should be suppressed.

Syntax
subroutine set_suppress_printing(class(errors) this, logical x)
void set_suppress_printing(error_handler *err, bool x)
Sets a logical value determining if printing of error and warning messages should be suppressed.
Parameters
[in,out]thisThe errors object.
[in]xSet to true if message printing should be suppressed; else, false to allow printing.

Definition at line 303 of file ferror.f90.


The documentation for this type was generated from the following file: