diff options
author | Pedro Algarvio <pedro@algarvio.me> | 2012-02-13 13:56:40 +0100 |
---|---|---|
committer | Pedro Algarvio <pedro@algarvio.me> | 2012-02-13 13:56:40 +0100 |
commit | ebe0e6039d822e9c16a6095dba8691066bc3b466 (patch) | |
tree | a7b04c302262badc0d96deb7c146dc3c32e60a11 /module/threads | |
parent | Add the internal server error messages to the pyfile. (diff) | |
download | pyload-ebe0e6039d822e9c16a6095dba8691066bc3b466.tar.xz |
Catch internal server errors on the right place.
Diffstat (limited to 'module/threads')
-rw-r--r-- | module/threads/DownloadThread.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/module/threads/DownloadThread.py b/module/threads/DownloadThread.py index c151831a3..879dbf8bd 100644 --- a/module/threads/DownloadThread.py +++ b/module/threads/DownloadThread.py @@ -26,6 +26,7 @@ from pycurl import error from module.plugins.Base import Fail, Retry from module.plugins.Hoster import Abort, Reconnect, SkipDownload +from module.network.HTTPRequest import BadHeader from BaseThread import BaseThread @@ -102,7 +103,12 @@ class DownloadThread(BaseThread): self.log.info(_("Download restarted: %(name)s | %(msg)s") % {"name": pyfile.name, "msg": reason}) self.queue.put(pyfile) continue - + except BadHeader, e: + if e.code == 500: + self.log.info(_("Internal Server Error")) + pyfile.error = _("Internal Server Error") + pyfile.plugin.tempOffline() + raise e except Fail, e: msg = e.args[0] @@ -212,4 +218,4 @@ class DownloadThread(BaseThread): def stop(self): """stops the thread""" - self.put("quit")
\ No newline at end of file + self.put("quit") |