We just ran into a situation where the Qt app is constructing an invalid "where clause" and the underlying web error need to be handled. For instance, when querying a "date field" we have to use the "event_date = DATE '2020-02-29' " or "event_date = TIMESTAMP '2020-02-29 00:00:00' " SQL expressions. So when we were using the UNIX timestamp directly like "event_date=1582934400" the REST endpoint returned:
{ "error" : { "code" : 400, "message" : "Cannot perform query. Invalid query parameters.", "details" : [ "Unable to perform query. Please check your parameters." ] } }
The FeatureTable::queryFeaturesCompleted slot is called and gets an uninitialized FeatureQueryResult instance.
We took a look at the current ArcGIS Runtime .NET implementation and the runtime is throwing a web exception wrapping the returned details.
Is it possible to get the underlying web error by using the current Qt implementation?
Hi Jan Tschada,
No, unfortunately there is no guaranteed way to get the http service error from the Qt API. In some cases, this information will be part of the error object, and you can connect to that like follows:
connect(featureTable, &FeatureTable::errorOccurred, this, [](const Error& error)
{
qDebug() << "FeatureTable error:" << error.message() << error.additionalMessage();
});
But however, it is not a guarantee that this information will be included with the error object.
Let me know if this helps.
Works like a charm thank you.