mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 17:38:35 +02:00
Settings: Fix an issue where read errors were not properly reported
Since we were not failing the open for a settings read failure, any errors would go unnoticed.
This commit is contained in:
+10
-1
@@ -202,8 +202,17 @@ bool Device::open() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!settings->disabled)
|
if(!settings->disabled) {
|
||||||
|
// Since we will not fail the open if a settings read fails,
|
||||||
|
// downgrade any errors to warnings. Otherwise the error will
|
||||||
|
// go unnoticed in the opening thread's getLastError buffer.
|
||||||
|
const bool downgrading = EventManager::GetInstance().isDowngradingErrorsOnCurrentThread();
|
||||||
|
if(!downgrading)
|
||||||
|
EventManager::GetInstance().downgradeErrorsOnCurrentThread();
|
||||||
settings->refresh();
|
settings->refresh();
|
||||||
|
if(!downgrading)
|
||||||
|
EventManager::GetInstance().cancelErrorDowngradingOnCurrentThread();
|
||||||
|
}
|
||||||
|
|
||||||
MessageFilter filter;
|
MessageFilter filter;
|
||||||
filter.includeInternalInAny = true;
|
filter.includeInternalInAny = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user