summaryrefslogtreecommitdiffstats
path: root/src/BluetoothGattService.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/BluetoothGattService.cpp')
-rw-r--r--src/BluetoothGattService.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/BluetoothGattService.cpp b/src/BluetoothGattService.cpp
index c1d35be8..31757ac1 100644
--- a/src/BluetoothGattService.cpp
+++ b/src/BluetoothGattService.cpp
@@ -109,11 +109,11 @@ BluetoothDevice BluetoothGattService::get_device ()
NULL,
&error);
- if (device == NULL) {
- g_printerr("Error instantiating: %s",
- error->message);
+ if (device == nullptr) {
+ std::string error_msg("Error occured while instantiating device: ");
+ error_msg += error->message;
g_error_free(error);
- throw std::exception();
+ throw std::runtime_error(error_msg);
}
return BluetoothDevice(device);