Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2461)

Unified Diff: device/bluetooth/bluetooth_adapter_mac.mm

Issue 2745323002: Adding std::ostream& operator<<(std::ostream& out, NSError* error) (Closed)
Patch Set: Moving operator<< to bluetooth_adapter_mac.mm Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_adapter_mac.h ('k') | device/bluetooth/bluetooth_low_energy_device_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_adapter_mac.mm
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index 667bbd6e06425cd14a23461624b662165cbff694..7ecac69a5de80fbd65ff1be6ca84927c90c777ff 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -674,11 +674,9 @@ void BluetoothAdapterMac::DidFailToConnectPeripheral(CBPeripheral* peripheral,
BluetoothDevice::ConnectErrorCode::ERROR_UNKNOWN;
if (error) {
error_code = BluetoothDeviceMac::GetConnectErrorCodeFromNSError(error);
- VLOG(1) << "Converting Bluetooth error, domain: " << error.domain.UTF8String
- << ", error code: " << error.code << ", to: " << error_code;
}
VLOG(1) << *device_mac << ": Failed to connect to peripheral with error "
- << error;
+ << error << ", error code: " << error_code;
device_mac->DidFailToConnectGatt(error_code);
}
@@ -726,4 +724,14 @@ bool BluetoothAdapterMac::DoesCollideWithKnownDevice(
return false;
}
+DEVICE_BLUETOOTH_EXPORT std::ostream& operator<<(std::ostream& out,
+ NSError* error) {
+ if (!error) {
+ return out << "no error";
+ }
+ return out << "error domain: " << base::SysNSStringToUTF8(error.domain)
+ << ", code: " << std::to_string(error.code) << ", description: "
+ << base::SysNSStringToUTF8(error.localizedDescription);
+}
+
} // namespace device
« no previous file with comments | « device/bluetooth/bluetooth_adapter_mac.h ('k') | device/bluetooth/bluetooth_low_energy_device_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698