mirror of
https://github.com/mayflower/docker-ls.git
synced 2025-11-28 00:01:09 +03:00
Implement paginated repository list.
This commit is contained in:
33
lib/api_errors.go
Normal file
33
lib/api_errors.go
Normal file
@@ -0,0 +1,33 @@
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user