1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
Delyan Angelov 2020-07-11 11:26:22 +03:00
parent d44fe50953
commit 2ea187fb85

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.