Export more symbols, refactor how this is laid out for dll compliance

PiperOrigin-RevId: 402286243
This commit is contained in:
jfcarroll
2021-10-11 07:05:49 -07:00
committed by Copybara-Service
parent 51a19d24c1
commit 99b77bda8e
11 changed files with 185 additions and 60 deletions
@@ -14,6 +14,7 @@
#include "platform/impl/windows/bluetooth_classic_socket.h"
#include "platform/base/logging.h"
#include "platform/impl/windows/generated/winrt/Windows.Networking.Sockets.h"
namespace location {
@@ -123,8 +124,11 @@ Exception BluetoothSocket::BluetoothOutputStream::Write(const ByteArray& data) {
buffer.Length(data.size());
try {
winrt_stream_.WriteAsync(buffer).get();
} catch (std::exception exception) {
auto hresult = winrt_stream_.WriteAsync(buffer).get();
} catch (winrt::hresult_error const& ex) {
NEARBY_LOGS(ERROR) << __func__ << ": winrt exception: " << ex.code() << ": "
<< winrt::to_string(ex.message());
return {Exception::kFailed};
}