Skip to content

Commit a7e29bd

Browse files
authored
feat: Add @throws to graindoc documentation (#333)
1 parent d1f60b1 commit a7e29bd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/tooling/graindoc.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ This attribute requires a description of the return value. In the Grain standard
6969

7070
When generating docs, the type of the return value will be detected by the compiler and added to the row in the "Returns" table.
7171

72+
### @throws
73+
74+
```gr
75+
/**
76+
* @throws Exception(Types): description
77+
*/
78+
79+
/**
80+
* @throws Exception: description
81+
*/
82+
```
83+
84+
The `@throws` attribute provides information about any exceptions the function may throw.
85+
86+
This attribute requires an exception and types of the exception data before the colon (`:`) and a description of when the exception occurs after the colon.
87+
88+
When generating docs, adds the exception to the output followed by a list of cases where the exception occurs.
89+
7290
### @example
7391

7492
```gr

0 commit comments

Comments
 (0)