Make an invalid download target fatal

This should never happen, so there's no reason for it to log an error
instead of raising an exception.
This commit is contained in:
Florian Bruhin 2016-09-10 16:25:33 +02:00
parent b2d8905d68
commit bd5f63db46

View File

@ -981,8 +981,8 @@ class DownloadManager(QAbstractListModel):
target.cmdline))
download.autoclose = True
download.set_fileobj(fobj)
else:
log.downloads.error("Unknown download target: {}".format(target))
else: # pragma: no cover
raise ValueError("Unknown download target: {}".format(target))
def _open_download(self, download, cmdline):
"""Open the given download but only if it was successful.