Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-94963

QWebEngineLoadingInfo::errorDomain() returns WebEngineError::InternalErrorDomain when there is no error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 6.4.0 Beta1
    • 6.2.0 Alpha
    • WebEngine
    • None
    • 4c4ac0df9c (qt/qtwebengine/dev)

    Description

      The errorCode is used to provide the HTTP Status Code :

      src/core/web_contents_delegate_qt.cpp
      m_loadingInfo.errorCode = http_statuscode;
      

      However, the error code is always used to find the error domain:

      src/core/web_contents_delegate_qt.cpp
      void WebContentsDelegateQt::emitLoadFinished(bool isErrorPage)
      {
          ...
          auto errorDomain = static_cast<QWebEngineLoadingInfo::ErrorDomain>(WebEngineError::toQtErrorDomain(m_loadingInfo.errorCode));
           ...
      }
      

      And for some reason WebEngineError::toQtErrorDomain() returns WebEngineError::InternalErrorDomain when the error code does not fit in other domains, which is the case when there is no error and the errorCode is in fact an HTTP status code.

      I suggest changing WebEngineError::toQtErrorDomain() so that a positive error code is included in WebEngineError::NoErrorDomain.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kiburtse Kirill Burtsev
            bterrier Benjamin Terrier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes