Using error code to check for resource error
This commit is contained in:
parent
03560b08df
commit
34509ad6d6
|
@ -132,14 +132,19 @@ void DeviceFinder::addDevice(const char *path)
|
||||||
}
|
}
|
||||||
catch(HIDPP10::Error &e)
|
catch(HIDPP10::Error &e)
|
||||||
{
|
{
|
||||||
if(e.errorCode() != HIDPP10::Error::UnknownDevice)
|
if (e.errorCode() == HIDPP10::Error::ResourceError)
|
||||||
{
|
{
|
||||||
if(remaining_tries == 1)
|
if(remaining_tries == 1)
|
||||||
{
|
{
|
||||||
log_printf(WARN, "While querying %s, wireless device %d: %s", string_path.c_str(), index, e.what());
|
log_printf(WARN, "While querying %s (possibly asleep), wireless device %d: %s", string_path.c_str(), index, e.what());
|
||||||
remaining_tries += MAX_CONNECTION_TRIES; // asleep wireless devices may raise this error, so warn but do not stop querying device
|
remaining_tries += MAX_CONNECTION_TRIES; // asleep devices may raise a resource error, so do not count this try
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(e.errorCode() != HIDPP10::Error::UnknownDevice)
|
||||||
|
{
|
||||||
|
if(remaining_tries == 1)
|
||||||
|
log_printf(ERROR, "While querying %s, wireless device %d: %s", string_path.c_str(), index, e.what());
|
||||||
|
}
|
||||||
else device_unknown = true;
|
else device_unknown = true;
|
||||||
}
|
}
|
||||||
catch(HIDPP20::Error &e)
|
catch(HIDPP20::Error &e)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user