[nostalgia/developer-handbook] Update notes on error handling
All checks were successful
Build / build (push) Successful in 3m13s
All checks were successful
Build / build (push) Successful in 3m13s
This commit is contained in:
parent
2c20ad0d53
commit
69049e9295
8
deps/nostalgia/developer-handbook.md
vendored
8
deps/nostalgia/developer-handbook.md
vendored
@ -227,6 +227,14 @@ int caller5(int i) {
|
||||
int caller6(int i) {
|
||||
return foo(i).unwrapThrow(); // unwrap will throw if there is an error
|
||||
}
|
||||
|
||||
int caller7(int i) {
|
||||
return foo(i).or_value(0); // will return 0 if foo returned an error
|
||||
}
|
||||
|
||||
ox::Result<uint64_t> caller8(int i) {
|
||||
return foo(i).to<uint64_t>(); // will convert the result of foo to uint64_t
|
||||
}
|
||||
```
|
||||
|
||||
Lastly, there are a few macros available to help in passing ```ox::Error```s
|
||||
|
Loading…
x
Reference in New Issue
Block a user