-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use std::expected instead of std::error_code reference #11
Merged
Jacquwes
merged 16 commits into
master
from
10-use-stdexpected-as-return-type-instead-of-passing-error_code-reference
Sep 16, 2024
Merged
Use std::expected instead of std::error_code reference #11
Jacquwes
merged 16 commits into
master
from
10-use-stdexpected-as-return-type-instead-of-passing-error_code-reference
Sep 16, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…an equivalent to std::expected
Updated `receive_raw_message` and `send_raw_message` methods in the `connection` class to return `async_operation` with `std::error_code`. This change eliminates the need to pass error codes by reference. Implemented error handling using `co_return` with `std::make_error_code`. Added a check in `send_raw_message` to ensure message size matches bytes sent. Included `error.h` in `connection.cpp`.
Replaced individual `using` declarations for `tl::unexpected`, `tl::expected`, `tl::make_unexpected`, and `tl::swap` with a single `using namespace tl;` statement within the `std` namespace. This change reduces redundancy and makes the code cleaner and easier to maintain.
Jacquwes
had a problem deploying
to
github-pages
September 16, 2024 12:44
— with
GitHub Actions
Failure
Jacquwes
deleted the
10-use-stdexpected-as-return-type-instead-of-passing-error_code-reference
branch
September 16, 2024 21:19
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Classification
API change to modernize and simplify error handling.
PR Summary
Refactored codebase to use
std::expected
andasync_operation
withstd::error_code
for improved error handling.client_connection.h
andclient_connection.cpp
: Switched toasync_operation
withstd::error_code
.server.h
andserver.cpp
: Adoptedstd::expected
for error handling.coroutine.h
: Replacedasync_task
withasync_operation
usingstd::expected
.client_example.cpp
andserver_example.cpp
: Updatedmain
function for new error handling.CMakeLists.txt
: Included newexpected.h
header file.closes: #10