Updated error messages and added missing arguments
@@ -1372,7 +1372,8 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse &
}
else
{
- rsp.list.append(errorToMap(ERR_ACTION_ERROR, QString("/sensors/%1/config/locked"), QString("Could not set attribute")));
+ rsp.list.append(errorToMap(ERR_ACTION_ERROR, QString("/sensors/%1/config/%2").arg(id).arg(pi.key()).toHtmlEscaped(),
+ QString("Could not set attribute")));
rsp.httpStatus = HttpStatusBadRequest;
return REQ_READY_SEND;
}
@@ -1380,7 +1381,8 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse &
}
else
{
- rsp.list.append(errorToMap(ERR_INVALID_VALUE, QString("/sensors/%1/config/locked"), QString("Invalid attribute value")));
+ rsp.list.append(errorToMap(ERR_INVALID_VALUE, QString("/sensors/%1/config/%2").arg(id).arg(pi.key()).toHtmlEscaped(),
+ QString("invalid value, %1, for parameter %2").arg(map[pi.key()].toString()).arg(pi.key()).toHtmlEscaped()));
rsp.httpStatus = HttpStatusBadRequest;
return REQ_READY_SEND;
}
@@ -1399,7 +1401,8 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse &
}
else
{
- rsp.list.append(errorToMap(ERR_ACTION_ERROR, QString("/sensors/%1/config/displayflipped"), QString("Could not set attribute")));
+ rsp.list.append(errorToMap(ERR_ACTION_ERROR, QString("/sensors/%1/config/%2").arg(id).arg(pi.key()).toHtmlEscaped(),
+ QString("Could not set attribute")));
rsp.httpStatus = HttpStatusBadRequest;
return REQ_READY_SEND;
}
@@ -1407,7 +1410,8 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse &
}
else
{
- rsp.list.append(errorToMap(ERR_INVALID_VALUE, QString("/sensors/%1/config/displayflipped"), QString("Invalid attribute value")));
+ rsp.list.append(errorToMap(ERR_INVALID_VALUE, QString("/sensors/%1/config/%2").arg(id).arg(pi.key()).toHtmlEscaped(),
+ QString("invalid value, %1, for parameter %2").arg(map[pi.key()].toString()).arg(pi.key()).toHtmlEscaped()));
rsp.httpStatus = HttpStatusBadRequest;
return REQ_READY_SEND;
}
@@ -1426,7 +1430,8 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse &
}
else
{
- rsp.list.append(errorToMap(ERR_ACTION_ERROR, QString("/sensors/%1/config/mountingmode"), QString("Could not set attribute")));
+ rsp.list.append(errorToMap(ERR_ACTION_ERROR, QString("/sensors/%1/config/%2").arg(id).arg(pi.key()).toHtmlEscaped(),
+ QString("Could not set attribute")));
rsp.httpStatus = HttpStatusBadRequest;
return REQ_READY_SEND;
}
@@ -1434,7 +1439,8 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse &
}
else
{
- rsp.list.append(errorToMap(ERR_INVALID_VALUE, QString("/sensors/%1/config/mountingmode"), QString("Invalid attribute value")));
+ rsp.list.append(errorToMap(ERR_INVALID_VALUE, QString("/sensors/%1/config/%2").arg(id).arg(pi.key()).toHtmlEscaped(),
+ QString("invalid value, %1, for parameter %2").arg(map[pi.key()].toString()).arg(pi.key()).toHtmlEscaped()));
rsp.httpStatus = HttpStatusBadRequest;
return REQ_READY_SEND;
}
