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

doc: simplify custom error example

This commit is contained in:
Alexander Medvednikov 2023-04-07 07:12:13 +02:00 committed by GitHub
parent 65abfa8219
commit eb6dd82d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3826,10 +3826,11 @@ fn (err PathError) msg() string {
return 'Failed to open path: ${err.path}'
}
fn try_open(path string) ? {
return IError(PathError{
fn try_open(path string) ! {
// V automatically casts this to IError
return PathError{
path: path
})
}
}
fn main() {