From d3c91164aff6a620348c81776fdae37fa41b81c3 Mon Sep 17 00:00:00 2001 From: JJ Date: Thu, 9 May 2024 18:18:15 -0700 Subject: docs: update for previous commit accordingly --- docs/ERRORS.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/ERRORS.md') diff --git a/docs/ERRORS.md b/docs/ERRORS.md index 33c15d5..cce29c1 100644 --- a/docs/ERRORS.md +++ b/docs/ERRORS.md @@ -46,11 +46,11 @@ If an exception is not handled within a function body, the function must be expl Despite functioning here as exceptions: errors remain types. An error thrown from an unwrapped `Result[T, E]` is of type `E`. `catch` statements, then, may pattern match upon possible errors, behaving similarly to `of` branches. ```puck -try: +try ... -catch "Error": +catch "Error" then ... -finally: +finally ... ``` @@ -65,7 +65,7 @@ This can make it difficult to do monadic error handling elegantly: one could ret ```puck pub func set[T](self: list[T], i: uint, val: T) = - if i > self.length: + if i > self.length then raise IndexOutOfBounds self.data.raw_set(offset = i, val) ``` -- cgit v1.2.3-70-g09d2