Skip to content

Commit 6a8a901

Browse files
committed
spec_check:following suggestion @certik
1 parent 3e0f3f7 commit 6a8a901

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/stdlib_experimental_error.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,24 @@ Aborts the program with a message and a nonzero exit code.
9595

9696
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.
9797

98-
### Example
98+
### Examples
99+
100+
Without error code:
101+
102+
```fortran
103+
program demo_error_stop1
104+
use stdlib_experimental_error, only: error_stop
105+
implicit none
106+
call error_stop("Invalid argument")
107+
end program demo_error_stop1
108+
```
109+
110+
With error code:
99111

100112
```fortran
101-
program demo_error_stop
113+
program demo_error_stop2
102114
use stdlib_experimental_error, only: error_stop
103115
implicit none
104116
call error_stop("Invalid argument", code = 123)
105-
end program demo_error_stop
117+
end program demo_error_stop2
106118
```

0 commit comments

Comments
 (0)