mirror of
https://github.com/mayflower/docker-ls.git
synced 2025-11-28 00:01:09 +03:00
34 lines
741 B
Go
34 lines
741 B
Go
package lib
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type AutorizationError string
|
|
type NotImplementedByRemoteError string
|
|
type MalformedResponseError string
|
|
type InvalidStatusCodeError string
|
|
|
|
var genericAuthorizationError AutorizationError = "autorization failed"
|
|
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 newInvalidStatusCodeError(code int) error {
|
|
return InvalidStatusCodeError(fmt.Sprintf("invalid API response status %d", code))
|
|
}
|