Skip to content

Commit 86ed2f3

Browse files
authored
Merge pull request #503 from JHenneberg/refactor/He/documentation
refactor documentation regarding consistency
2 parents ab51f0a + b6259e2 commit 86ed2f3

File tree

2 files changed

+198
-191
lines changed

2 files changed

+198
-191
lines changed

doc/specs/stdlib_error.md

+22-15
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,33 @@
22
title: error
33
---
44

5-
# Catching and handling errors
5+
# The `stdlib_error` module
66

77
[TOC]
88

9-
## `check` - Checks the value of a logical condition
9+
## Introduction
1010

11-
### Status
11+
Catching and handling errors.
12+
13+
## Procedures and methods provided
14+
15+
16+
### `check` - Checks the value of a logical condition
17+
18+
#### Status
1219

1320
Experimental
1421

15-
### Description
22+
#### Description
1623

1724
Checks the value of a logical condition.
1825

19-
### Syntax
26+
#### Syntax
2027

2128
`call [[check(subroutine)]](condition, msg, code, warn)`
2229

2330

24-
### Arguments
31+
#### Arguments
2532

2633
`condition`: Shall be a scalar of type `logical`.
2734

@@ -31,7 +38,7 @@ Checks the value of a logical condition.
3138

3239
`warn` (optional): Shall be a scalar of type `logical`. The default `warn` is `.true.`.
3340

34-
### Return value
41+
#### Return value
3542

3643
If `condition` is `.false.`, and:
3744

@@ -43,7 +50,7 @@ If `condition` is `.false.`, and:
4350

4451
* `warn` is provided and `warn` is `.true.`, this subroutine doesn't stop the program and prints the message.
4552

46-
### Examples
53+
#### Examples
4754

4855
```fortran
4956
program demo_check1
@@ -82,31 +89,31 @@ program demo_check3
8289
end program demo_check3
8390
```
8491

85-
## `error_stop` - aborts the program
92+
### `error_stop` - aborts the program
8693

87-
### Status
94+
#### Status
8895

8996
Experimental
9097

91-
### Description
98+
#### Description
9299

93100
Aborts the program with a message and a nonzero exit code.
94101

95-
### Syntax
102+
#### Syntax
96103

97104
`call [[stdlib_error(module):error_stop(interface)]](msg, code)`
98105

99-
### Arguments
106+
#### Arguments
100107

101108
`msg`: Shall be a character expression containing the message to be printed to `stderr`.
102109

103110
`code` (optional): Shall be a scalar of type `integer` to be returned as exit code.
104111

105-
### Output
112+
#### Output
106113

107114
Aborts the program with printing the message `msg` to `stderr` and a nonzero exit code. The nonzero exit code is equal to `code` if provided, and 1 otherwise.
108115

109-
### Examples
116+
#### Examples
110117

111118
Without error code:
112119

0 commit comments

Comments
 (0)