{"action":"opened","issue":{"url":"https://api.github.com/repos/jiaweihli/manga_downloader/issues/82","repository_url":"https://api.github.com/repos/jiaweihli/manga_downloader","labels_url":"https://api.github.com/repos/jiaweihli/manga_downloader/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/jiaweihli/manga_downloader/issues/82/comments","events_url":"https://api.github.com/repos/jiaweihli/manga_downloader/issues/82/events","html_url":"https://github.com/jiaweihli/manga_downloader/issues/82","id":182176301,"number":82,"title":"Exceptions in DownloadChapterThread.run are being silenced","user":{"login":"CharlieCorner","id":817475,"avatar_url":"https://avatars.githubusercontent.com/u/817475?v=3","gravatar_id":"","url":"https://api.github.com/users/CharlieCorner","html_url":"https://github.com/CharlieCorner","followers_url":"https://api.github.com/users/CharlieCorner/followers","following_url":"https://api.github.com/users/CharlieCorner/following{/other_user}","gists_url":"https://api.github.com/users/CharlieCorner/gists{/gist_id}","starred_url":"https://api.github.com/users/CharlieCorner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CharlieCorner/subscriptions","organizations_url":"https://api.github.com/users/CharlieCorner/orgs","repos_url":"https://api.github.com/users/CharlieCorner/repos","events_url":"https://api.github.com/users/CharlieCorner/events{/privacy}","received_events_url":"https://api.github.com/users/CharlieCorner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-11T05:23:15Z","updated_at":"2016-10-11T05:23:15Z","closed_at":null,"body":"Recently #81 was raised to troubleshoot a problem when downloading chapters, but the Tracebacks that were shared didn't have enough information to pinpoint exactly where the code actually broke and why.\r\n\r\nThis is because in `base.py` lines 391-403 of the `DownloadChapterThread` class we are re-raising a `FatalError` with just a short message but not preserving the original Traceback:\r\n\r\n```python\r\n\tdef run (self):\r\n\t\ttry:\r\n\t\t\tself.siteParser.processChapter(self, self.chapter)\t\r\n\t\texcept Exception as exception:\r\n\t\t\t# Assume semaphore has not been release\r\n\t\t\t# This assumption could be faulty if the error was thrown in the compression function\r\n\t\t\t# The worst case is that releasing the semaphore would allow one more thread to \r\n\t\t\t# begin downloading than it should\r\n\t\t\t#\r\n\t\t\t# If the semaphore was not released before the exception, it could cause deadlock\r\n\t\t\tchapterThreadSemaphore.release()\r\n\t\t\tself.isThreadFailed = True\r\n\t\t\traise FatalError(\"Thread crashed while downloading chapter: %s\" % str(exception))\r\n```\r\nIf an Exception is raised in any part of the underlying code in `self.siteParse.processChapter(self, self.chapter)` it will be silenced by the code on line 403 where we `raise FatalError`.\r\n\r\nWe need to find a way to either wrap the original exception properly in a FatalError, or just re-raise the original `exception` altogether so as not to lose our ability to hunt down bugs.\r\n\r\nUnless I'm skipping something is raising our custom FatalError really giving us any value here?"}}
{"actor":{"display_login":"CharlieCorner"}}