Feature request #8158
QgsNetworkAccessManager timeout should raise a more clear error message than just "Operation aborted"
Status: | Open | ||
---|---|---|---|
Priority: | Low | ||
Assignee: | - | ||
Category: | Unknown | ||
Pull Request or Patch supplied: | No | Resolution: | |
Easy fix?: | No | Copied to github as #: | 16984 |
Description
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.
History
#1 Updated by Jürgen Fischer over 11 years ago
Is that a verbatim message or translated back from Polish?
#2 Updated by Borys Jurgiel over 11 years ago
The latter. I mean QNetworkReply::OperationCanceledError.
#3 Updated by Matthias Kuhn about 11 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 QgsNetworkAccessManager
.
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.
#4 Updated by Giovanni Manghi over 7 years ago
- Easy fix? set to No
#5 Updated by Jürgen Fischer about 7 years ago
- Category set to Unknown