Error value
Inspired by the excellent, MIT licensed https://github.com/samharrison7/fortran-error-handler
Fortran doesn't have a null value. As a result, we introduce this derived type with the convention that a code of 0 indicates no error.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | NO_ERROR_CODE | = | 0 | Code that indicates no error |
Constructor function: see docs of [[m_error_v(module):build(procedure)]] for details.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | code | |||
| character(len=*), | intent(in), | optional | :: | message |
Error value
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | code | = | 1 | Error code |
|
| character(len=128), | public | :: | message | = | "" | Error message |
| private function constructor(code, message) | Constructor function: see docs of [[m_error_v(module):build(procedure)]] for details. |
| procedure, public :: finalise | |
| procedure, public :: build |