Add ConflictError (309)

This commit is contained in:
Alex Root Junior 2017-08-22 20:28:22 +03:00
parent d4f1b72d92
commit 09fa911ffa
2 changed files with 9 additions and 3 deletions

View file

@ -1,11 +1,11 @@
_PREFIXES = ['Error: ', '[Error]: ', 'Bad Request: ']
_PREFIXES = ['Error: ', '[Error]: ', 'Bad Request: ', 'Conflict: ']
def _clean_message(text):
for prefix in _PREFIXES:
if text.startswith(prefix):
text = text[len(prefix):]
return text
return (text[0].upper() + text[1:]).strip()
class TelegramAPIError(Exception):
@ -21,6 +21,10 @@ class BadRequest(TelegramAPIError):
pass
class ConflictError(TelegramAPIError):
pass
class Unauthorized(TelegramAPIError):
pass