-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Public Result
class encapsulating a result value and a status code
#207
feat: Public Result
class encapsulating a result value and a status code
#207
Conversation
…nto feat/enhance-result-class
Result
class encapsulating a result value and a status codeResult
class encapsulating a result value and a status code
…nto feat/enhance-result-class
…nto feat/enhance-result-class
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #207 +/- ##
==========================================
- Coverage 85.14% 83.90% -1.25%
==========================================
Files 80 78 -2
Lines 4356 4181 -175
Branches 1746 971 -775
==========================================
- Hits 3709 3508 -201
+ Misses 204 198 -6
- Partials 443 475 +32
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hi @lukasberbuer , After incorporating your feedback I'll update the documentation in async_model.md accordingly. Kind regards |
Hi @chandryan, thank you for your great contribution! 👍 As I mentioned in #193, the
The You already changed the async model to use the
|
Hi @lukasberbuer ! Indeed I misunderstood "battle-proven", I thought you just meant thinking about the API details of the Result class and making sure tests are complete ^^ Regarding the default interface of sync & async functions: I was worried about users not wanting to use Regarding the callback interface: We could support both interfaces, though I see disadvantages when not using I prefer the
Since the callback with Regarding the options for where to put the Result class: I would choose experimental over detail for the
|
Hi @chandryan, I think you are right. Keeping both interfaces will make it just more complicated in the long run. I personally favor the The roadmap of the new exception handling mechanism is still not clear to me. In the end, every service which might fail could return a Let's keep the PR as it is for now. I will take a deeper dive through the code the next days 😊 |
I love it, great work! 🎉 |
Hi @chandryan, could you please merge the master branch again. I had to fix some CI issues:
|
Currently, |
…nto feat/enhance-result-class
Thanks for spotting this, I forgot to add it! An additional member should not be required, the status code could be queried in a similar fashion as in This has been my thought train: I looked at As opposed to For |
You added the default constructor for |
I see no disadvantages, I have added a default constructor as you suggested 👍 |
Great, thanks @chandryan. Have you seen the comments in the review? Besides those small adjustments, I would like to merge it as soon as possible 😊 |
I currently don't see any open comments I haven't addressed yet, though it's easy to loose orientation without having the possibility to open threads within this page in GitHub 😆 Short summary:
Regarding review comments: When I look at the top right of this page I see "No reviews". If you have done one, could you double-check whether you submitted it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn, I forgot to submit 😅
Ready to merge @chandryan? |
Yes, please go ahead :-) |
Great work, thank you! 😊 |
Provision of a public Result class as described in #193.
The class mostly follows the design of C++'s
std::expected
.Summary of changes:
Result:
Async method handling:
Result<T>
instead ofStatusCode
andT
future<Result<T>>
Error handling: