xcapclient 1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ERRORS.rdoc ADDED
@@ -0,0 +1,123 @@
1
+
2
+ == Errors
3
+
4
+ The XCAPClient library includes custom Ruby exceptions. All these exceptions inherit from XCAPClient::XCAPClientError exception.
5
+
6
+
7
+ === Exceptions tree
8
+
9
+ * StandardError
10
+ * XCAPClientError
11
+ * ConfigError
12
+ * ArgumentError
13
+ * ConnectionError
14
+ * WrongAUID
15
+ * DocumentError
16
+ * HTTPError
17
+ * HTTPAuthenticationError
18
+ * HTTPNoMatchingETag
19
+ * HTTPConflictError
20
+ * HTTPDocumentNotModified
21
+ * HTTPDocumentNotFound
22
+ * HTTPWrongContentType
23
+ * HTTPBadRequest
24
+ * HTTPServerError
25
+ * HTTPUnknownError
26
+ * XMLParsingError
27
+
28
+
29
+ ==== ConfigError < XCAPClientError
30
+
31
+ An error has occurred related to the client settings.
32
+
33
+
34
+ ==== ArgumentError < XCAPClientError
35
+
36
+ Wrong argument passed to a method.
37
+
38
+
39
+ ==== ConnectionError < XCAPClientError
40
+
41
+ Couldn't contact the server (i.e: network issue).
42
+
43
+
44
+ ==== WrongAUID < XCAPClientError
45
+
46
+ There is no application with such auid name.
47
+
48
+
49
+ ==== DocumentError < XCAPClientError
50
+
51
+ Error accesing (it doesn't exist) or creating a local document (it already exists).
52
+
53
+
54
+ ==== HTTPError < XCAPClientError
55
+
56
+ A non 2XX HTTP response has been received from the XCAP server.
57
+
58
+
59
+ ==== HTTPAuthenticationError < HTTPError
60
+
61
+ The server replied "401 Unauthorized" or "407 Proxy Authentication Required". The server requires authentication (XCAPClient allows Digest and Basic authentication). XCAPClient handles it automatically (if "auth_user" and "password" are set), however the client could receive 401/407 due to wrong user/password.
62
+
63
+
64
+ ==== HTTPNoMatchingETag < HTTPError
65
+
66
+ The server replied "412 Precondition Failed". It occurs when using ETag in "If-Match" header for a PUT or DELETE request. It means that the server has a more modern version of the document than the client.
67
+
68
+ Example:
69
+
70
+ begin
71
+ @xcapclient.put("pres-rules")
72
+ rescue XCAPClientError::HTTPNoMatchingETag
73
+ STDERR.puts "Error: the document has been modified in the server by other client."
74
+ end
75
+
76
+
77
+ ==== HTTPConflictError < HTTPError
78
+
79
+ The server replied "409 Conflict". It occurs when the request couldn't be performed in the server.
80
+
81
+
82
+ ==== HTTPDocumentNotModified < HTTPError
83
+
84
+ The server replied "304 Not Modified". It occurs when using ETag in "If-None-Match" header for a GET request. It means that the document has not been modified in the server so it's not fetched again (as the client already has it in a local cache).
85
+
86
+ Example:
87
+
88
+ begin
89
+ @xcapclient.get("pres-rules")
90
+ rescue XCAPClientError::HTTPDocumentNotModified
91
+ puts "The document has not been modified in the server."
92
+ end
93
+
94
+
95
+ ==== HTTPDocumentNotFound < HTTPError
96
+
97
+ The server replied "404 Document Not Found". It means that the document or node doesn't exist.
98
+
99
+
100
+ ==== HTTPWrongContentType < HTTPError
101
+
102
+ The value of the "Content-Type" in the response from the server doesn't match the expected value.
103
+
104
+
105
+ ==== HTTPBadRequest < HTTPError
106
+
107
+ The server replied "400 Bad Request". The request was malformed.
108
+
109
+
110
+ ==== HTTPServerError < HTTPError
111
+
112
+ The server replied "500 Internal Server Error". The server encountered an unexpected condition which prevented it from fulfilling the request.
113
+
114
+
115
+ ==== HTTPUnknownError < HTTPError
116
+
117
+ Any other HTTP error response.
118
+
119
+
120
+ ==== XMLParsingError < XCAPClientError
121
+
122
+ An error ocurred when parsing a XML file (i.e: wrong XML syntax). Note that XCAPClient just parses XML when fetching a node namespaces or "xcap-caps" document.
123
+