fortplot_errors Module

Error handling module for fortplot library Provides centralized error management with status codes and messages



Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: SUCCESS = 0
integer, public, parameter :: ERROR_INVALID_INPUT = 1
integer, public, parameter :: ERROR_DIMENSION_MISMATCH = 2
integer, public, parameter :: ERROR_RESOURCE_LIMIT = 3
integer, public, parameter :: ERROR_INTERNAL = 4
integer, public, parameter :: ERROR_FILE_IO = 5

Derived Types

type, public ::  fortplot_error_t

Error result type containing status and message

Components

Type Visibility Attributes Name Initial
integer, public :: status = SUCCESS
character(len=MAX_ERROR_MESSAGE), public :: message = ""

Type-Bound Procedures

procedure, public :: set_error
procedure, public :: clear_error
procedure, public :: is_error => error_has_error

type, public ::  fortplot_status_t

Status type for simpler error handling

Components

Type Visibility Attributes Name Initial
integer, public :: code = SUCCESS

Functions

public function is_error(status) result(has_error)

Check if status code indicates an error

Arguments

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

Return Value logical

public function get_error_message(status) result(message)

Get descriptive error message for status code

Arguments

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

Return Value character(len=MAX_ERROR_MESSAGE)


Subroutines

public subroutine log_error(status, context)

Log error message to error unit

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: status
character(len=*), intent(in), optional :: context