From 2ea187fb85fb0c5e769e1a8204be8f6e1cfe24b2 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 11 Jul 2020 11:26:22 +0300 Subject: [PATCH] doc: mention throw/try/catch in the Option section, so people can find it easier --- doc/docs.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/docs.md b/doc/docs.md index f353d65343..a3d0f8f943 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -1391,6 +1391,7 @@ If you don't need to return an error message, you can simply `return none` (this This is the primary mechanism for error handling in V. They are still values, like in Go, but the advantage is that errors can't be unhandled, and handling them is a lot less verbose. +Unlike other languages, V does not handle exceptions with `throw/try/catch` blocks. `err` is defined inside an `or` block and is set to the string message passed to the `error()` function. `err` is empty if `none` was returned.