1
0
mirror of https://github.com/mayflower/docker-ls.git synced 2025-11-26 12:03:12 +03:00
Files
docker-ls/lib/api_errors.go
Christian Speckner 207c0547a2 Typo.
2016-02-24 16:21:15 +01:00

52 lines
1.1 KiB
Go

package lib
import (
"fmt"
)
type AutorizationError string
type NotImplementedByRemoteError string
type MalformedResponseError string
type InvalidStatusCodeError string
type NotFoundError string
type InvalidRequestError string
var genericAuthorizationError AutorizationError = "authorization rejected by registry"
var genericMalformedResponseError MalformedResponseError = "malformed response"
func (e AutorizationError) Error() string {
return string(e)
}
func (e NotImplementedByRemoteError) Error() string {
return string(e)
}
func (e MalformedResponseError) Error() string {
return string(e)
}
func (e InvalidStatusCodeError) Error() string {
return string(e)
}
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))
}
func newNotFoundError(description string) error {
return NotFoundError(description)
}
func newInvalidRequestError(description string) error {
return InvalidRequestError(description)
}