[SignalR-Client-Cpp] Cannot properly handle invalid url #43774
Labels
area-signalr
Includes: SignalR clients and servers
bug
This issue describes a behavior which is not expected - a bug.
feature-client-c++
Related to the SignalR C++ client
Milestone
Is there an existing issue for this?
Describe the bug
When use a url like "/something" then start the connection,
It seems that underline lib cpprest does not allow empty host and throw the exception, but the exception does not return in the callback, instead, it terminates the program.
and this cannot be catched in anyway because the function
hub_connection::start(std::function<void(std::exception_ptr)> callback) noexcept;
is anoexcept
functionhttps://docs.microsoft.com/en-us/cpp/cpp/noexcept-cpp?view=msvc-170
Expected Behavior
With the mark of noexcept in hub_connection::start() function, any exceptions that might occur are expected to be in the callback.
Otherwise, it should not be marked with noexcept and let user handle any exception that might come out from it.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: