diff options
Diffstat (limited to 'src/tinyb_utils.cpp')
-rw-r--r-- | src/tinyb_utils.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tinyb_utils.cpp b/src/tinyb_utils.cpp index a1f2a5d..449ef1e 100644 --- a/src/tinyb_utils.cpp +++ b/src/tinyb_utils.cpp @@ -23,6 +23,7 @@ */ #include "tinyb_utils.hpp" +#include "BluetoothException.hpp" std::vector<unsigned char> tinyb::from_gbytes_to_vector(const GBytes *bytes) { @@ -50,3 +51,12 @@ GBytes *tinyb::from_vector_to_gbytes(const std::vector<unsigned char>& vector) return result; } + +void tinyb::handle_error(GError *error) +{ + if (error != nullptr) { + BluetoothException e(error->message); + g_error_free(error); + throw e; + } +} |