Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

api: instantiate ProtocolError in twisted-like (code, msg) fashion

  • Loading branch information...
commit 397f338027ce1f7f53c65416e53f26abe8177541 1 parent b0cc910
@mk-fg authored
Showing with 6 additions and 6 deletions.
  1. +2 −2 doc/api.md
  2. +1 −1  setup.py
  3. +3 −3 skydrive/api_v5.py
View
4 doc/api.md
@@ -281,12 +281,12 @@
Bases: "exceptions.Exception"
-* **exception skydrive.api\_v5.ProtocolError(msg, code=None)**
+* **exception skydrive.api\_v5.ProtocolError(code, msg)**
Bases: "skydrive.api\_v5.SkyDriveInteractionError"
- * \_\_init\_\_(msg, code=None)
+ * \_\_init\_\_(code, msg)
* **exception skydrive.api\_v5.AuthenticationError**
View
2  setup.py
@@ -12,7 +12,7 @@
setup(
name = 'python-skydrive',
- version = '12.10.12',
+ version = '12.10.13',
author = 'Mike Kazantsev',
author_email = 'mk.fraggod@gmail.com',
license = 'WTFPL',
View
6 skydrive/api_v5.py
@@ -17,8 +17,8 @@
class SkyDriveInteractionError(Exception): pass
class ProtocolError(SkyDriveInteractionError):
- def __init__(self, msg, code=None):
- super(ProtocolError, self).__init__(msg)
+ def __init__(self, code, msg):
+ super(ProtocolError, self).__init__(code, msg)
self.code = code
class AuthenticationError(SkyDriveInteractionError): pass
@@ -62,7 +62,7 @@ def request( self, url, method='get', data=None,
if code != requests.codes.ok: res.raise_for_status()
return json.loads(res.text) if not raw else res.content
except requests.RequestException as err:
- raise raise_for.get(code, ProtocolError)(err.message, code)
+ raise raise_for.get(code, ProtocolError)(code, err.message)
Please sign in to comment.
Something went wrong with that request. Please try again.