Download function for card data.

This commit is contained in:
luxick
2017-07-12 12:04:46 +02:00
parent 7784520c2e
commit e7c2d9199d
10 changed files with 467 additions and 95 deletions

View File

@@ -10,7 +10,7 @@
import json
from urllib.request import Request, urlopen
from urllib.error import HTTPError
from urllib.error import HTTPError, URLError
from urllib.parse import urlencode
@@ -37,6 +37,8 @@ class RestClient(object):
return response
except HTTPError as err:
raise MtgException(err.read())
except URLError as err:
raise MtgException(str(err.reason))
class MtgException(Exception):