Implementation of basic error handling.
Data type defining an error
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | public, | allocatable | :: | message |
Error message |
| Type | Intent | Optional | 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 |
Generic fatal runtime error
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(error_t), | intent(out), | allocatable | :: | error |
Instance of the error data |
|
| character(len=*), | intent(in) | :: | message |
Error message |
Error created when a file is missing or not found
| Type | Intent | Optional | 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 |
Error created when file parsing fails
| Type | Intent | Optional | 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 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | value |
value to use on STOP |
||
| character(len=*), | intent(in) | :: | message |
Error message |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(error_t), | intent(out), | allocatable | :: | error |
Instance of the error data |
|
| character(len=*), | intent(in) | :: | message |
Error message |