mirror of
https://github.com/mayflower/docker-ls.git
synced 2025-11-28 00:01:09 +03:00
Add docker-rm for deleting tag, refine error handling.
This commit is contained in:
@@ -9,6 +9,7 @@ type NotImplementedByRemoteError string
|
||||
type MalformedResponseError string
|
||||
type InvalidStatusCodeError string
|
||||
type NotFoundError string
|
||||
type InvalidRequestError string
|
||||
|
||||
var genericAuthorizationError AutorizationError = "autorization failed"
|
||||
var genericMalformedResponseError MalformedResponseError = "malformed response"
|
||||
@@ -33,6 +34,10 @@ func (e NotFoundError) Error() string {
|
||||
return string(e)
|
||||
}
|
||||
|
||||
func (e InvalidRequestError) Error() string {
|
||||
return string(e)
|
||||
}
|
||||
|
||||
func newInvalidStatusCodeError(code int) error {
|
||||
return InvalidStatusCodeError(fmt.Sprintf("invalid API response status %d", code))
|
||||
}
|
||||
@@ -40,3 +45,7 @@ func newInvalidStatusCodeError(code int) error {
|
||||
func newNotFoundError(description string) error {
|
||||
return NotFoundError(description)
|
||||
}
|
||||
|
||||
func newInvalidRequestError(description string) error {
|
||||
return InvalidRequestError(description)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user