diff --git a/Builder/src/main.cpp b/Builder/src/main.cpp index d83e46b..4426810 100644 --- a/Builder/src/main.cpp +++ b/Builder/src/main.cpp @@ -215,8 +215,11 @@ int main(int argc, char *argv[]) { Logger::error("Unknown exception caught!"); } - // Close connection - client_stream.close(websocket::close_code::normal); - + // Attempt to close connection + try { + client_stream.close(websocket::close_code::normal); + } catch(...) { + Logger::error("Failed to cleanly close the WebSocket"); + } return 0; } \ No newline at end of file diff --git a/Client/src/main.cpp b/Client/src/main.cpp index b534540..8b20710 100644 --- a/Client/src/main.cpp +++ b/Client/src/main.cpp @@ -265,9 +265,13 @@ int main(int argc, char *argv[]) { Logger::error("Unknown exception caught!"); } - // Disconnect from builder and queue - builder_stream.close(websocket::close_code::normal); - queue_stream.close(websocket::close_code::normal); + // Attempt to disconnect from builder and queue + try { + builder_stream.close(websocket::close_code::normal); + queue_stream.close(websocket::close_code::normal); + } catch(...) { + Logger::debug("Failed to cleanly close the WebSockets"); + } // Show the cursor std::cout<<"\e[?25h";