Feature request #8158
QgsNetworkAccessManager timeout should raise a more clear error message than just "Operation aborted"
|Pull Request or Patch supplied:||No||Resolution:|
|Easy fix?:||No||Copied to github as #:||16984|
Requests controlled by QgsNetworkAccessManager are aborted every 20 seconds (by default) by its timeout timer. As a result, an "Operation aborted" error is raised, what may be confusing and doesn't help to figure out the timeout period needs to be increased.
#3 Updated by Matthias Kuhn over 6 years ago
The problem is, that a timeout simply calls
QNetworkReply::abort(). There is no possibility to set the reason for the abort this way, because
QNetworkReply::setError is protected. Subclassing
QNetworkReply seems not to be very easy, because at the same time the code from
QNetworkAccessManager::createRequest would have to be copied and maintained in
As a simple workaround, we could set a custom property on the QNetworkReply (
reply->setProperty( "QgsAbortReason", "Timeout" ); or similar). Does not seem to be the most beautiful, but at least a pragmatic solution.