You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Enum representing various errors in the Message Transfer Protocol (MTP).
2
+
/// These errors are categorized into Client Errors (100-115) and Server Errors (120-128).
3
+
/// These errors are also sent along with Response
4
+
/// These errors indicate issues on the client side of the protocol.
5
+
6
+
/// - 100 - Bad Request: The request could not be understood or was missing required parameters.
7
+
/// BadRequest100(Error),
8
+
9
+
/// - 101 - Unauthorized: Authentication is required and has failed or has not been provided.
10
+
/// Unauthorized101(Error),
11
+
12
+
/// - 102 - Forbidden: The request is understood, but it has been refused or access is not allowed.
13
+
/// Forbidden102(Error),
14
+
15
+
/// - 103 - Not Found: The requested resource could not be found.
16
+
/// NotFound103(Error),
17
+
18
+
/// - 104 - Method Not Allowed: The method specified in the request is not allowed for the resource.
19
+
/// MethodNotAllowed104(Error),
20
+
21
+
/// - 105 - Not Acceptable: The resource is capable of generating only content not acceptable according to the Accept headers sent in the request.
22
+
/// NotAcceptable105(Error),
23
+
24
+
/// - 106 - Proxy Authentication Required: Authentication with a proxy is required.
25
+
/// ProxyAuthenticationRequired106(Error),
26
+
27
+
/// - 107 - Request Timeout: The server timed out waiting for the request.
28
+
/// RequestTimeout107(Error),
29
+
30
+
/// - 108 - Conflict: The request could not be processed because of conflict in the current state of the resource.
31
+
/// Conflict108(Error),
32
+
33
+
/// - 109 - Gone: The requested resource is no longer available and will not be available again.
34
+
/// Gone109(Error),
35
+
36
+
/// - 110 - Precondition Failed: The server does not meet one of the preconditions that the requester put on the request.
37
+
/// PreconditionFailed110(Error),
38
+
39
+
/// - 111 - Payload Too Large: The request is larger than the server is willing or able to process.
40
+
/// PayloadTooLarge111(Error),
41
+
42
+
/// - 112 - Unprocessable Content: The server understands the content type of the request entity, but was unable to process the contained instructions.
43
+
/// UnprocessableContent112(Error),
44
+
45
+
/// - 113 - Locked: The resource is currently locked and cannot be accessed.
46
+
/// Locked113(Error),
47
+
48
+
/// - 114 - Too Many Requests: The user has sent too many requests in a given amount of time.
49
+
/// TooManyRequests114(Error),
50
+
51
+
/// - 115 - Request Header Too Large: The request headers are too large for the server to process.
52
+
/// RequestHeaderTooLarge115(Error),
53
+
54
+
/// These errors indicate issues on the server side of the protocol.
55
+
/// - 120 - Internal Server Error: An unexpected condition was encountered on the server.
56
+
/// InternalServerError120(Error),
57
+
58
+
/// - 121 - Bad Gateway: The server received an invalid response from the upstream server.
59
+
/// BadGateway121(Error),
60
+
61
+
/// - 123 - Service Unavailable: The server is currently unable to handle the request due to a temporary overload or maintenance.
62
+
/// ServiceUnavailable123(Error),
63
+
64
+
/// - 124 - Gateway Timeout: The server did not receive a timely response from the upstream server or some other auxiliary server.
65
+
/// GatewayTimeout124(Error),
66
+
67
+
/// - 125 - MTP Version Not Supported: The MTP version used in the request is not supported by the server.
68
+
/// MTPVersionNotSupported125(Error),
69
+
70
+
/// - 126 - Insufficient Storage: The server is unable to store the representation needed to complete the request.
71
+
/// InsufficientStorage126(Error),
72
+
73
+
/// - 127 - Loop Detected: The server detected an infinite loop while processing the request.
/// let error = ProtocolError::BadRequest100(Error { message: "Invalid request".to_string() });
213
+
/// assert_eq!(error.description(), "100 - Bad Request: The request could not be understood or was missing required parameters.");
214
+
/// ```
215
+
fndescription(&self) -> &'staticstr{
216
+
matchself{
217
+
ProtocolError::BadRequest100(_) => "100 - Bad Request: The request could not be understood or was missing required parameters.",
218
+
ProtocolError::Unauthorized101(_) => "101 - Unauthorized: Authentication is required and has failed or has not been provided.",
219
+
ProtocolError::Forbidden102(_) => "102 - Forbidden: The request is understood, but it has been refused or access is not allowed.",
220
+
ProtocolError::NotFound103(_) => "103 - Not Found: The requested resource could not be found.",
221
+
ProtocolError::MethodNotAllowed104(_) => "104 - Method Not Allowed: The method specified in the request is not allowed for the resource.",
222
+
ProtocolError::NotAcceptable105(_) => "105 - Not Acceptable: The resource is capable of generating only content not acceptable according to the Accept headers sent in the request.",
223
+
ProtocolError::ProxyAuthenticationRequired106(_) => "106 - Proxy Authentication Required: Authentication with a proxy is required.",
224
+
ProtocolError::RequestTimeout107(_) => "107 - Request Timeout: The server timed out waiting for the request.",
225
+
ProtocolError::Conflict108(_) => "108 - Conflict: The request could not be processed because of conflict in the current state of the resource.",
226
+
ProtocolError::Gone109(_) => "109 - Gone: The requested resource is no longer available and will not be available again.",
227
+
ProtocolError::PreconditionFailed110(_) => "110 - Precondition Failed: The server does not meet one of the preconditions that the requester put on the request.",
228
+
ProtocolError::PayloadTooLarge111(_) => "111 - Payload Too Large: The request is larger than the server is willing or able to process.",
229
+
ProtocolError::UnprocessableContent112(_) => "112 - Unprocessable Content: The server understands the content type of the request entity, but was unable to process the contained instructions.",
230
+
ProtocolError::Locked113(_) => "113 - Locked: The resource is currently locked and cannot be accessed.",
231
+
ProtocolError::TooManyRequests114(_) => "114 - Too Many Requests: The user has sent too many requests in a given amount of time.",
232
+
ProtocolError::RequestHeaderTooLarge115(_) => "115 - Request Header Too Large: The request headers are too large for the server to process.",
233
+
ProtocolError::InternalServerError120(_) => "120 - Internal Server Error: An unexpected condition was encountered on the server.",
234
+
ProtocolError::BadGateway121(_) => "121 - Bad Gateway: The server received an invalid response from the upstream server.",
235
+
ProtocolError::ServiceUnavailable123(_) => "123 - Service Unavailable: The server is currently unable to handle the request due to a temporary overload or maintenance.",
236
+
ProtocolError::GatewayTimeout124(_) => "124 - Gateway Timeout: The server did not receive a timely response from the upstream server or some other auxiliary server.",
237
+
ProtocolError::MTPVersionNotSupported125(_) => "125 - MTP Version Not Supported: The MTP version used in the request is not supported by the server.",
238
+
ProtocolError::InsufficientStorage126(_) => "126 - Insufficient Storage: The server is unable to store the representation needed to complete the request.",
239
+
ProtocolError::LoopDetected127(_) => "127 - Loop Detected: The server detected an infinite loop while processing the request.",
0 commit comments