fpm_error Module

Implementation of basic error handling.



Derived Types

type, public ::  error_t

Data type defining an error

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: message

Error message


Functions

public function bad_name_error(error, label, name)

Arguments

Type IntentOptional Attributes Name
type(error_t), intent(out), allocatable :: error

Instance of the error data

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

Error message label to add to message

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

name value to check

Return Value logical


Subroutines

public subroutine fatal_error(error, message)

Generic fatal runtime error

Arguments

Type IntentOptional Attributes Name
type(error_t), intent(out), allocatable :: error

Instance of the error data

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

Error message

public subroutine file_not_found_error(error, file_name)

Error created when a file is missing or not found

Arguments

Type IntentOptional Attributes Name
type(error_t), intent(out), allocatable :: error

Instance of the error data

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

Name of the missing file

public subroutine file_parse_error(error, file_name, message, line_num, line_string, line_col)

Error created when file parsing fails

Arguments

Type IntentOptional Attributes Name
type(error_t), intent(out), allocatable :: error

Instance of the error data

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

Name of file

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

Parse error message

integer, intent(in), optional :: line_num

Line number of parse error

character(len=*), intent(in), optional :: line_string

Line context string

integer, intent(in), optional :: line_col

Line context column

public subroutine fpm_stop(value, message)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: value

value to use on STOP

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

Error message

public subroutine syntax_error(error, message)

Arguments

Type IntentOptional Attributes Name
type(error_t), intent(out), allocatable :: error

Instance of the error data

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

Error message