Skip to content

Commit eb6dd82

Browse files
authored
doc: simplify custom error example
1 parent 65abfa8 commit eb6dd82

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/docs.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3826,10 +3826,11 @@ fn (err PathError) msg() string {
38263826
return 'Failed to open path: ${err.path}'
38273827
}
38283828
3829-
fn try_open(path string) ? {
3830-
return IError(PathError{
3829+
fn try_open(path string) ! {
3830+
// V automatically casts this to IError
3831+
return PathError{
38313832
path: path
3832-
})
3833+
}
38333834
}
38343835
38353836
fn main() {

0 commit comments

Comments
 (0)