File tree Expand file tree Collapse file tree 5 files changed +43
-33
lines changed
Expand file tree Collapse file tree 5 files changed +43
-33
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ title: "Documentation"
1717- [ ` func ` ] ( /docs/keywords/func )
1818- [ ` walk ` ] ( /docs/keywords/walk )
1919- [ ` while ` ] ( /docs/keywords/while )
20- - [ ` unsafe ` ] ( /docs/keywords/unsafe )
21- - [ ` safe ` ] ( /docs/keywords/safe )
20+ - [ ` try ` ] ( /docs/keywords/try )
21+ - [ ` catch ` ] ( /docs/keywords/catch )
2222- [ ` fetch ` ] ( /docs/keywords/fetch )
2323- [ ` give ` ] ( /docs/keywords/give )
2424- [ ` next ` ] ( /docs/keywords/next )
Original file line number Diff line number Diff line change 1+ ---
2+ title : " catch"
3+ ---
4+
5+ # Keyword: ` catch `
6+
7+ Represents the safe block of code to execute after a ` try ` block fails. _ Used in chain with the [ ` try ` keyword] ( /docs/keywords/try ) ._
8+
9+ ```
10+ try {
11+ # ...
12+ } safe error {
13+ bark("Some error occured: " + error);
14+ }
15+ ```
16+
17+ ` safe ` takes an ` <indentifier> ` as the error output, where ` <indentifier> ` is a string type with the encountered error inside.
18+
19+ ```
20+ try {
21+ 1 / 0;
22+ } catch division_error {
23+ bark(division_error); # output: division by 0
24+ }
25+ ```
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ ---
2+ title : " try"
3+ ---
4+
5+ # Keyword: ` try `
6+
7+ Represents the unsafe block of code to execute. _ Used in chain with the [ ` catch ` keyword] ( /docs/keywords/catch ) _ .
8+
9+ ```
10+ try {
11+ # dangerous code
12+ 1 / 0
13+ } catch _ {
14+ # ...
15+ }
16+ ```
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments