diff --git a/examples/handle_errors.py b/examples/handle_errors.py index 7120d4e..67c373e 100644 --- a/examples/handle_errors.py +++ b/examples/handle_errors.py @@ -5,4 +5,4 @@ import scrython try: search = scrython.cards.Search(q="!Black Lotus") except scrython.ScryfallError as e: - print(str(e.status) + ' ' + e.code + ': ' + e.details) + print(str(e.error_details['status']) + ' ' + e.error_details['code'] + ': ' + e.error_details['details']) diff --git a/scrython/foundation.py b/scrython/foundation.py index cbe5ad1..844224c 100644 --- a/scrython/foundation.py +++ b/scrython/foundation.py @@ -35,7 +35,7 @@ class FoundationObject(object): loop.run_until_complete(main(loop)) if self.scryfallJson['object'] == 'error': - raise ScryfallError(self.scryfallJson, message=self.scryfallJson['details']) + raise ScryfallError(self.scryfallJson, self.scryfallJson['details']) def _checkForKey(self, key): """Checks for a key in the scryfallJson object.