Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add error messages for QtWebEngine downloads
Fixes #2164
  • Loading branch information
The-Compiler committed Jun 6, 2017
1 parent 0e85342 commit d4f5853
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Expand Up @@ -70,6 +70,8 @@ Changed
closes the current tab.
- (QtWebEngine) With Qt 5.9, `content -> cookies-store` can now be set without
a restart.
- (QtWebEngine) With Qt 5.9, better error messages are now shown for failed
downloads.
- The adblocker now also blocks non-GET requests (e.g. POST).
- `javascript:` links can now be hinted.
- `:view-source`, `:tab-clone` and `:navigate --tab` now don't open the tab as
Expand Down
7 changes: 6 additions & 1 deletion qutebrowser/browser/webengine/webenginedownloads.py
Expand Up @@ -77,7 +77,12 @@ def _on_state_changed(self, state):
elif state == QWebEngineDownloadItem.DownloadInterrupted:
self.successful = False
# https://bugreports.qt.io/browse/QTBUG-56839
self._die("Download failed")
try:
reason = self._qt_item.interruptReasonString()
except AttributeError:
# Qt < 5.9
reason = "Download failed"
self._die(reason)
else:
raise ValueError("_on_state_changed was called with unknown state "
"{}".format(state_name))
Expand Down

0 comments on commit d4f5853

Please sign in to comment.