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

View File

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