Show error message when download dir is readonly
when the download directory cannot be written to, an error message is shown. This can help users spot a configuration error where the download dir is set to a folder that does not exist or is not writable by the user.
This commit is contained in:
parent
42dfd1bc94
commit
081f120808
|
@ -2545,7 +2545,13 @@ class gPodder(BuilderWidget, dbus.service.Object):
|
|||
if task_exists:
|
||||
continue
|
||||
|
||||
task = download.DownloadTask(episode)
|
||||
try:
|
||||
task = download.DownloadTask(episode)
|
||||
except Exception, e:
|
||||
self.show_message(_('Download error while downloading %s:\n\n%s') % (episode.title, str(e)), _('Download error'))
|
||||
log('Download error while downloading %s', episode.title, sender=self, traceback=True)
|
||||
continue
|
||||
|
||||
if add_paused:
|
||||
task.status = task.PAUSED
|
||||
self.download_queue_manager.add_resumed_task(task)
|
||||
|
|
|
@ -254,9 +254,12 @@ class CoverDownloader(ObservableService):
|
|||
|
||||
if image_data is not None:
|
||||
log('Saving image data to %s', channel.cover_file, sender=self)
|
||||
fp = open(channel.cover_file, 'wb')
|
||||
fp.write(image_data)
|
||||
fp.close()
|
||||
try:
|
||||
fp = open(channel.cover_file, 'wb')
|
||||
fp.write(image_data)
|
||||
fp.close()
|
||||
except IOError, ioe:
|
||||
log('Cannot save image due to I/O error', sender=self, traceback=True)
|
||||
|
||||
if os.path.exists(channel.cover_file):
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue