forked from maxcutler/python-wordpress-xmlrpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions.py
More file actions
47 lines (36 loc) · 1.13 KB
/
Copy pathexceptions.py
File metadata and controls
47 lines (36 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
class ServerConnectionError(Exception):
"""
An error while attempting to connect to the XML-RPC endpoint.
"""
pass
class UnsupportedXmlrpcMethodError(Exception):
"""
An error while attempting to call a method that is not
supported by the XML-RPC server.
"""
pass
class XmlrpcDisabledError(Exception):
"""
An error when XML-RPC services are disabled in WordPress.
"""
pass
class InvalidCredentialsError(Exception):
"""
An error when the XML-RPC server rejects the user's credentials
(username/password combination).
"""
pass
class FieldConversionError(Exception):
"""
An error while converting field Python value to XML-RPC value type.
Attributes:
`field_name`: name of the field
`input_value`: value that was passed to the conversion function
"""
def __init__(self, field_name, error):
self.field_name = field_name
self.error = error
def __str__(self):
return repr(self)
def __repr__(self):
return u'%s (%s)' % (self.field_name, str(self.error))