Remove catching websocketpp::lib::error_code in examples, fixes #584
A few versions ago the library was standardized to only throw websocketpp::exception. Not all example code was updated.
This commit is contained in:
@@ -128,9 +128,9 @@ void on_message(server* s, websocketpp::connection_hdl hdl, message_ptr msg) {
|
||||
|
||||
try {
|
||||
s->send(hdl, msg->get_payload(), msg->get_opcode());
|
||||
} catch (const websocketpp::lib::error_code& e) {
|
||||
std::cout << "Echo failed because: " << e
|
||||
<< "(" << e.message() << ")" << std::endl;
|
||||
} catch (websocketpp::exception const & e) {
|
||||
std::cout << "Echo failed because: "
|
||||
<< "(" << e.what() << ")" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,10 +164,10 @@ int main() {
|
||||
|
||||
// Start the ASIO io_service run loop
|
||||
echo_server.run();
|
||||
} catch (websocketpp::exception const & e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
} catch (const std::exception & e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
} catch (websocketpp::lib::error_code e) {
|
||||
std::cout << e.message() << std::endl;
|
||||
} catch (...) {
|
||||
std::cout << "other exception" << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user