cable_error_handler_base_mod Module

This module defines the base error handler type for CABLE. It provides a default implementation of the error handling behaviour, which can be extended to provide custom error handling.



Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: DEFAULT_ERROR_CODE = 999

Default error code to use when none is provided


Derived Types

type, public ::  cable_error_handler_base_t

Base error handler type for CABLE. This type provides a default implementation of the error handling behaviour.

Type-Bound Procedures

procedure, public :: build_error_message => cable_error_handler_base_build_error_message
procedure, public :: abort => cable_error_handler_base_abort

Functions

private function cable_error_handler_base_build_error_message(this, message, file, line, error_code) result(error_message)

Build an error message string.

Arguments

Type IntentOptional Attributes Name
class(cable_error_handler_base_t), intent(inout) :: this
character(len=*), intent(in) :: message

Error message to display

character(len=*), intent(in) :: file

Source file where the error occurred

integer, intent(in) :: line

Line number where the error occurred

integer, intent(in), optional :: error_code

Optional error code

Return Value character(len=:), allocatable


Subroutines

private subroutine cable_error_handler_base_abort(this, message, file, line, error_code)

Default implementation of the abort procedure for the base error handler.

Arguments

Type IntentOptional Attributes Name
class(cable_error_handler_base_t), intent(inout) :: this
character(len=*), intent(in) :: message

Error message to display

character(len=*), intent(in) :: file

Source file where the error occurred

integer, intent(in) :: line

Line number where the error occurred

integer, intent(in), optional :: error_code

Optional error code