Throw Execption as "return false" is not handled

if no hostname configured nor device was discovered
This commit is contained in:
LordGrey 2019-04-10 23:08:56 +02:00
parent c16ecde539
commit 5b17924cdf
1 changed files with 1 additions and 2 deletions

View File

@ -102,8 +102,7 @@ bool LedDeviceNanoleaf::init(const QJsonObject &deviceConfig) {
if ( _hostname.isEmpty() )
//Discover Nanoleaf device
if ( !discoverNanoleafDevice() ) {
Error(_log, "No target IP defined nor Nanoleaf device discovered");
return false;
throw std::runtime_error("No target IP defined nor Nanoleaf device discovered");
}
//Get Nanoleaf device details and configuration