Add error handling to the email task within the convert task

pull/1580/head
blitzmann 4 years ago
parent 59d56d5c83
commit ac22483f98

@ -32,17 +32,20 @@ class TaskConvert(CalibreTask):
def run(self, worker_thread): def run(self, worker_thread):
self.worker_thread = worker_thread self.worker_thread = worker_thread
filename = self._convert_ebook_format() filename = self._convert_ebook_format()
# todo: re-enable this (need to set up gdrive to test with)
if filename: if filename:
if config.config_use_google_drive: if config.config_use_google_drive:
gdriveutils.updateGdriveCalibreFromLocal() gdriveutils.updateGdriveCalibreFromLocal()
if self.kindle_mail: if self.kindle_mail:
# if we're sending to kindle after converting, create a one-off task and run it immediately # if we're sending to kindle after converting, create a one-off task and run it immediately
# todo: figure out how to incorporate this into the progress # todo: figure out how to incorporate this into the progress
try:
task = TaskEmail(self.settings['subject'], self.results["path"], task = TaskEmail(self.settings['subject'], self.results["path"],
filename, self.settings, self.kindle_mail, filename, self.settings, self.kindle_mail,
self.settings['subject'], self.settings['body'], internal=True) self.settings['subject'], self.settings['body'], internal=True)
task.start() task.start()
except Exception as e:
return self._handleError(str(e))
self._handleSuccess() self._handleSuccess()
pass pass

Loading…
Cancel
Save