MecElectronics: Return proper error code on wrong authentication
parent
fc523cc7e6
commit
c2f13b16fe
|
|
@ -93,7 +93,13 @@ void IntegrationPluginMecMeter::confirmPairing(ThingPairingInfo *info, const QSt
|
|||
connect(reply, &QNetworkReply::finished, info, [=](){
|
||||
if (reply->error() != QNetworkReply::NoError) {
|
||||
qCWarning(dcMecElectronics()) << "Error connecting to mecmeter:" << reply->error() << reply->errorString();
|
||||
// Device responds with InternalServerError on wrong login
|
||||
if (reply->error() == QNetworkReply::InternalServerError) {
|
||||
info->finish(Thing::ThingErrorAuthenticationFailure, QT_TR_NOOP("The login credentials are not valid."));
|
||||
return;
|
||||
}
|
||||
info->finish(Thing::ThingErrorHardwareFailure);
|
||||
return;
|
||||
}
|
||||
|
||||
pluginStorage()->beginGroup(meterId);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,11 @@
|
|||
<source>Please enter your login credentials for the mecMeter.</source>
|
||||
<translation>Bitte gib Deine Logindaten für das mecMeter ein.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../integrationpluginmecelectronics.cpp" line="98"/>
|
||||
<source>The login credentials are not valid.</source>
|
||||
<translation>Die eingegebenen Login-Daten sind nicht korrekt.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>mecElectronics</name>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,11 @@
|
|||
<source>Please enter your login credentials for the mecMeter.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../integrationpluginmecelectronics.cpp" line="98"/>
|
||||
<source>The login credentials are not valid.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>mecElectronics</name>
|
||||
|
|
|
|||
Loading…
Reference in New Issue