Skip to content

Commit

Permalink
Bug Fix
Browse files Browse the repository at this point in the history
Fix import in __init__.py
Add login error exeption
  • Loading branch information
cpaillet committed Apr 20, 2016
1 parent 3f82b3d commit ec5c825
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions pycarwings2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__all__ = ['pycarwings2', 'responses']
from pycarwings2 import *
__version__ = '2.0'

7 changes: 4 additions & 3 deletions pycarwings2/pycarwings2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

# Copyright 2016 Jason Horne
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -77,7 +75,7 @@

BASE_URL = "https://gdcportalgw.its-mo.com/gworchest_0307C/gdc/"

log = logging.getLogger("pycarwings2")
log = logging.getLogger(__name__)

# from http://stackoverflow.com/questions/17134100/python-blowfish-encryption
def _PKCS5Padding(string):
Expand Down Expand Up @@ -135,6 +133,9 @@ def _request(self, endpoint, params):

j = json.loads(response.content)

if "message" in j and j["message"] == "INVALID PARAMS":
log.error("carwings error %s: %s" % (j["message"], j["status"]) )
raise CarwingsError("INVALID PARAMS")
if "ErrorMessage" in j:
log.error("carwings error %s: %s" % (j["ErrorCode"], j["ErrorMessage"]) )
raise CarwingsError
Expand Down

0 comments on commit ec5c825

Please sign in to comment.