diff --git a/internal/platform/implementation/windows/bluetooth_classic_server_socket.cc b/internal/platform/implementation/windows/bluetooth_classic_server_socket.cc index 113ec647..d33518e4 100644 --- a/internal/platform/implementation/windows/bluetooth_classic_server_socket.cc +++ b/internal/platform/implementation/windows/bluetooth_classic_server_socket.cc @@ -123,6 +123,14 @@ Exception BluetoothServerSocket::StartListening(bool radioDiscoverable) { LeaveCriticalSection(&critical_section_); + return {Exception::kFailed}; + } catch (const winrt::hresult_error& ex) { + NEARBY_LOGS(ERROR) << __func__ + << ": Exception setting up for listen: " << ex.code() + << ": " << winrt::to_string(ex.message()); + + LeaveCriticalSection(&critical_section_); + return {Exception::kFailed}; } @@ -145,6 +153,14 @@ Exception BluetoothServerSocket::StartAdvertising() { LeaveCriticalSection(&critical_section_); + return {Exception::kFailed}; + } catch (const winrt::hresult_error& ex) { + NEARBY_LOGS(ERROR) << __func__ + << ": Exception calling StartAdvertising: " << ex.code() + << ": " << winrt::to_string(ex.message()); + + LeaveCriticalSection(&critical_section_); + return {Exception::kFailed}; }