From 07ecbde112d0d40ef01cd55f2d0a850b6d540a0e Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Wed, 29 May 2024 00:00:25 -0500 Subject: [PATCH] [nostalgia/developer-handbook] Update notes on error handling --- developer-handbook.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/developer-handbook.md b/developer-handbook.md index 2a63ba91..cc668ba0 100644 --- a/developer-handbook.md +++ b/developer-handbook.md @@ -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 caller8(int i) { + return foo(i).to(); // will convert the result of foo to uint64_t +} ``` Lastly, there are a few macros available to help in passing ```ox::Error```s