Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Detect all the network erroneous cases with Qt
Forum Updated to NodeBB v4.3 + New Features

Detect all the network erroneous cases with Qt

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 792 Views 1 Watching
  • 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.
  • R Offline
    R Offline
    redstoneleo
    wrote on last edited by
    #1

    I want to get Page Source by the following code ,I wonder is it enough to detect all the network erroneous cases with the following code ?
    @
    if (reply.error()!= QNetworkReply.NoError):
    print('11111111', reply.errorString())
    return
    content=reply.readAll().data()
    if content==b'':
    print('---------', 'cannot find any resource !')
    return

    @

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      it's enough if you don't care about the specific type of the error...
      But a reply is either successful or not. Qt delivers you error types if it recognizes them, if not it still knows that a error happened and returns QNetworkReply::UnknownNetworkError.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      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