fixed string formatting in errors

This commit is contained in:
nir0s 2015-02-11 22:27:53 +02:00
parent ea2148ade1
commit dd1a6fc906
1 changed files with 3 additions and 3 deletions

View File

@ -30,15 +30,15 @@ class APIError(requests.exceptions.HTTPError):
message = super(APIError, self).__str__()
if self.is_client_error():
message = '%s Client Error: %s' % (
message = '{0} Client Error: {1}'.format(
self.response.status_code, self.response.reason)
elif self.is_server_error():
message = '%s Server Error: %s' % (
message = '{0} Server Error: {1}'.format(
self.response.status_code, self.response.reason)
if self.explanation:
message = '%s ("%s")' % (message, self.explanation)
message = '{0} ("{1}")'.format(message, self.explanation)
return message