Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. Which QNetworkReply error for connection timeout ?
QtWS25 Last Chance

Which QNetworkReply error for connection timeout ?

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
webassembly5.15timeout
2 Posts 1 Posters 845 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mixlu
    wrote on last edited by
    #1

    Hello,

    I am trying to catch in a similar way connection timeout error when sending a request to a non-existing server between MinGW and WASM in the QNetworkAccessManager::finished signal.

    Here are the results of the tests I have made (request to a non-existing server) :

    With QNetworkAccessManager::setTransferTimeout(3000) :

    MinGW : QNetworkReply::OperationCanceledError
    WASM : QNetworkReply::ProtocolFailure

    Without

    MinGW : QNetworkReply::UnknownNetworkError
    WASM : QNetworkReply::ContentNotFoundError

    We can see that there is not a common error.

    My question is, how could I differentiate a timeout error and a server who return an error ?

    I am using Qt 5.15.2

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Mixlu
      wrote on last edited by
      #2

      I just saw that a QNetworkReply::TimeoutError code exists. Shouldn't this code be set when a timeout occurred ? Is this a bug or did I misunderstand something ?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved