Skip to content
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

Add error_handler to asio_server #1602

Merged
merged 2 commits into from
Feb 7, 2025
Merged

Add error_handler to asio_server #1602

merged 2 commits into from
Feb 7, 2025

Conversation

stephenberry
Copy link
Owner

No description provided.

@stephenberry
Copy link
Owner Author

@gjb1002, What do you think about this solution? It adds a std::function<void(const std::string&)> error_handler{}; to provide a callback for handling errors. I think it needs to pass a std::string through to be generic.

It is important to realize that anything within the callback should be thread safe, as multiple threads could be calling this.

@stephenberry stephenberry merged commit 29e92b8 into main Feb 7, 2025
12 checks passed
@stephenberry stephenberry deleted the server_error_handler branch February 7, 2025 21:55
@gjb1002
Copy link

gjb1002 commented Feb 17, 2025

@stephenberry thanks for fix, looks like it resolves the issues I raised!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

glz::asio_server catches all exceptions and writes them to stderr without any identifying text
2 participants