From 6b67525a426ed06d34443aa3c3f00f587909c83c Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Fri, 6 Jul 2012 19:21:36 +0100 Subject: [PATCH] Raise exceptions correctly --- app/eve_api/tasks/character.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/eve_api/tasks/character.py b/app/eve_api/tasks/character.py index 363f1f2..3f6dce6 100644 --- a/app/eve_api/tasks/character.py +++ b/app/eve_api/tasks/character.py @@ -67,7 +67,7 @@ def import_eve_character_func(character_id, key_id=None, logger=logging.getLogge char_doc = CachedDocument.objects.api_query('/eve/CharacterInfo.xml.aspx', params={'characterID': character_id}, no_cache=False) except DocumentRetrievalError, exc: logger.error('Error retrieving CharacterInfo.xml.aspx for Character ID %s - %s' % (character_id, exc)) - raise APIAccessException(exc.value) + raise APIAccessException('Error retrieving CharacterInfo.xml.aspx for Character ID %s - %s' % (character_id, exc)) d = basic_xml_parse_doc(char_doc)['eveapi'] if 'error' in d: @@ -130,7 +130,7 @@ def import_eve_character_func(character_id, key_id=None, logger=logging.getLogge char_doc = CachedDocument.objects.api_query('/char/CharacterSheet.xml.aspx', params=auth_params, no_cache=False) except DocumentRetrievalError, exc: logger.error('Error retrieving CharacterSheet.xml.aspx for User ID %s, Character ID %s - %s' % (acc.pk, character_id, exc)) - raise APIAccessException + raise APIAccessException('Error retrieving CharacterSheet.xml.aspx for User ID %s, Character ID %s - %s' % (acc.pk, character_id, exc.value)) doc = basic_xml_parse_doc(char_doc)['eveapi'] if not 'error' in doc: