doc: mention throw/try/catch in the Option section, so people can find it easier

pull/5798/head
Delyan Angelov 2020-07-11 11:26:22 +03:00
parent d44fe50953
commit 2ea187fb85
1 changed files with 1 additions and 0 deletions

View File

@ -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.