Skip to content

Commit

Permalink
Mention which types are valid for type restriction on rescue
Browse files Browse the repository at this point in the history
Module types were added in crystal-lang/crystal#14552
  • Loading branch information
straight-shoota authored Jul 3, 2024
1 parent 7d9ff96 commit 561fe4b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/syntax_and_semantics/exception_handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ end
# Output: Rescued MyException
```

Valid type restrictions are subclasses of `::Exception`, module types and unions of these.

And to access it, use a syntax similar to type restrictions:

```crystal
Expand Down

0 comments on commit 561fe4b

Please sign in to comment.