You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it fails to catch the error that happen when it connects for example.
This is because the connection happens in a different thread, when the recoverableException is thrown from that thread, it doesn't get catched and thus crashes the client.
This could be solved by passing an error handler to the bluetoothConnector, but I can't get that to work.
My approach was to have a void that gets defined in MacOSBluetoothConnector::MacOSBluetoothConnector, but that gives an error at compilation: Reference to non-static member function must be called .
You can solve this using std::promise. You can create an std::promise<void> in connect, take its future, and then move it into the new thread. In the new thread you can set it with nothing or an exception as needed. Back in connect, get it to wait until the promise is resolved and propagate the exception if one was set.
Currently it fails to catch the error that happen when it connects for example.
This is because the connection happens in a different thread, when the recoverableException is thrown from that thread, it doesn't get catched and thus crashes the client.
This could be solved by passing an error handler to the bluetoothConnector, but I can't get that to work.
My approach was to have a
void
that gets defined inMacOSBluetoothConnector::MacOSBluetoothConnector
, but that gives an error at compilation:Reference to non-static member function must be called
.Used code:
The text was updated successfully, but these errors were encountered: