1
0
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:
Christian Speckner
2016-02-17 16:49:52 +01:00
parent e6cc9c2329
commit c174cc5b3d
11 changed files with 112 additions and 8 deletions

View File

@@ -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)
}