pub enum DecUseError {
ApiNotFound {
uri: String,
},
ApiNotImplemented {
uri: String,
},
HttpClientError(Error),
Internal(DecLibraryError),
NotFound {
message: String,
},
StreamLineRead(StreamLineReadError),
Rejected {
status: StatusCode,
message: String,
},
UnexpectedResponseContentType {
expected: String,
actual: Option<String>,
},
UnparseableJsonResponse {
status: StatusCode,
text: String,
parse_error: Error,
},
UnparseableUtf8Response {
status: StatusCode,
content_type: Option<String>,
parse_error: FromUtf8Error,
},
}
Expand description
An error during the use of a Docker Engine client.
Variants§
ApiNotFound
Received a 404 Not Found response for a list-based api.
Possible causes are:
- DockerEngineClient was misconfigured with an incorrect URL.
- URL is correct but the Docker Engine it points to is incompatible with this library
ApiNotImplemented
Server returned 501 Not Implemented, most likely
Possible causes are:
- DockerEngineClient was misconfigured with an incorrect URL.
- URL is correct but the Docker Engine it points to is incompatible with this library
HttpClientError(Error)
A communication failure occurred while sending an HTTP request or receiving its response.
Internal(DecLibraryError)
See docs for DecInternalError.
NotFound
An item managed by the Docker Engine, and required by the request, was not found (does not exist in the Docker Engine).
For example, you requested to start a container, but that container does not exist.
StreamLineRead(StreamLineReadError)
A problem while reading or parsing a container log or console output stream.
Rejected
Fields
status: StatusCode
HTTP status returned by the Docker Engine
Docker Engine rejected the request. Any number of failure status codes can produce this outcome, including but not limited to:
- 400 Bad Request
- 409 Conflict
- 500 Server Error
However, this will not be used for 404 Not Found responses.
UnexpectedResponseContentType
Received a response from the HTTP server with an unexpected or missing Content-Type.
UnparseableJsonResponse
Fields
status: StatusCode
HTTP status returned by the Docker Engine or whatever HTTP server we were connected to
A response was received, but could not be parsed.
The two most likely causes:
- The JSON was malformed (or not json at all)
- The JSON was well formed, but the structure did not match the client’s expectations
A reverse-proxy related failure can cause #1 above. Malformed JSON from the actual Docker Engine is highly unlikely.
This enum is a possible outcome for both HTTP success statuses and failure statuses.
UnparseableUtf8Response
Fields
status: StatusCode
HTTP status returned by the Docker Engine or whatever HTTP server we were connected to
content_type: Option<String>
HTTP Content-Type response header value returned by the Docker Engine or whatever HTTP server we were connected to
parse_error: FromUtf8Error
Error that prevented converting the HTTP response body bytes into UTF-8 (the encoding of application/json).
A response was received, but could not be decoded as UTF-8.
The most likely cause is a reverse-proxy related failure, and the reverse proxy sending back a non-UTF-8 plain text error message. Malformed UTF-8 from the actual Docker Engine is highly unlikely.
This enum is a possible outcome for both HTTP success statuses and failure statuses.