Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MsgNotLeader is returned by Do calls that are sent to a non leading Mesos master. MsgNotLeader = "call sent to a non-leading master" // MsgAuth is returned by Do calls that are not successfully authenticated. MsgAuth = "call not authenticated" // MsgUnsubscribed is returned by Do calls that are sent before a subscription is established. MsgUnsubscribed = "no subscription established" // MsgVersion is returned by Do calls that are sent to an incompatible API version. MsgVersion = "incompatible API version" // MsgMalformed is returned by Do calls that are malformed. MsgMalformed = "malformed request" // MsgMediaType is returned by Do calls that are sent with an unsupported media type. MsgMediaType = "unsupported media type" // MsgRateLimit is returned by Do calls that are rate limited. This is a temporary condition // that should clear. MsgRateLimit = "rate limited" // does not yet realize that it's the leader. This is a temporary condition that should clear. MsgUnavailable = "mesos server unavailable" // MsgNotFound could happen if the master or agent libprocess has not yet set up http routes. MsgNotFound = "mesos http endpoint not found" CodeNotLeader = Code(http.StatusTemporaryRedirect) CodeNotAuthenticated = Code(http.StatusUnauthorized) CodeUnsubscribed = Code(http.StatusForbidden) CodeIncompatibleVersion = Code(http.StatusConflict) CodeMalformedRequest = Code(http.StatusBadRequest) CodeUnsupportedMediaType = Code(http.StatusNotAcceptable) CodeRateLimitExceded = Code(http.StatusTooManyRequests) CodeNotFound = Code(http.StatusNotFound) // ErrorTable maps HTTP response codes to their respective Mesos v1 API error messages. ErrorTable = map[Code]string{ CodeNotLeader: MsgNotLeader, CodeMalformedRequest: MsgMalformed, CodeIncompatibleVersion: MsgVersion, CodeUnsubscribed: MsgUnsubscribed, CodeNotAuthenticated: MsgAuth, CodeUnsupportedMediaType: MsgMediaType, CodeNotFound: MsgNotFound, CodeMesosUnavailable: MsgUnavailable, CodeRateLimitExceded: MsgRateLimit, } )
Functions ¶
func FromResponse ¶
FromResponse returns an `*Error` for a response containing a status code that indicates an error condition. The response body (if any) is captured in the Error.Details field. Returns nil for nil responses and responses with non-error status codes. See IsErrorCode.
Types ¶
type Error ¶
type Error struct { Code Code // Code is the HTTP response status code generated by Mesos Message string // Message briefly summarizes the nature of the error Details string // Details captures the HTTP response entity, if any, supplied by Mesos }
Error captures HTTP v1 API error codes and messages generated by Mesos.
Click to show internal directories.
Click to hide internal directories.