Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AttributeError: type object 'GithubException' has no attribute 'B… #867

Merged
merged 4 commits into from
Aug 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions sickbeard/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
import platform
import re
import sys
import traceback

import tornado
import subliminal

from requests.compat import quote
from six import itervalues, text_type
from github import Github, InputFileContent, GithubException # pylint: disable=import-error
from github import Github, InputFileContent # pylint: disable=import-error
from github.GithubException import BadCredentialsException, RateLimitExceededException

import sickbeard
from sickbeard import classes
Expand Down Expand Up @@ -521,11 +521,14 @@ def is_malformed_error(title):
if issue_id and cur_error in classes.ErrorViewer.errors:
# clear error from error list
classes.ErrorViewer.errors.remove(cur_error)
except (GithubException.BadCredentialsException, GithubException.RateLimitExceededException) as e:
self.log('Error while accessing github: {0}'.format(e), WARNING)
except Exception: # pylint: disable=broad-except
self.log(traceback.format_exc(), ERROR)
submitter_result = 'Exception generated in issue submitter, please check the log'
except BadCredentialsException:
submitter_result = 'Please check your Github credentials in Medusa settings. Bad Credentials error'
issue_id = None
except RateLimitExceededException:
submitter_result = 'Please wait before submit new issues. Github Rate Limit Exceeded error'
issue_id = None
except Exception as e: # pylint: disable=broad-except
submitter_result = 'Exception generated in issue submitter. Error: {0}'.format(ex(e))
issue_id = None
finally:
self.submitter_running = False
Expand Down