libnetwork/types: remove unused RetryError and TimeoutError
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
7baab8bd6c
commit
c203171ef6
2 changed files with 0 additions and 58 deletions
|
@ -413,12 +413,6 @@ type MaskableError interface {
|
|||
Maskable()
|
||||
}
|
||||
|
||||
// RetryError is an interface for errors which might get resolved through retry
|
||||
type RetryError interface {
|
||||
// Retry makes implementer into RetryError type
|
||||
Retry()
|
||||
}
|
||||
|
||||
// BadRequestError is an interface for errors originated by a bad request
|
||||
type BadRequestError interface {
|
||||
// BadRequest makes implementer into BadRequestError type
|
||||
|
@ -443,12 +437,6 @@ type NoServiceError interface {
|
|||
NoService()
|
||||
}
|
||||
|
||||
// TimeoutError is an interface for errors raised because of timeout
|
||||
type TimeoutError interface {
|
||||
// Timeout makes implementer into TimeoutError type
|
||||
Timeout()
|
||||
}
|
||||
|
||||
// NotImplementedError is an interface for errors raised because of requested functionality is not yet implemented
|
||||
type NotImplementedError interface {
|
||||
// NotImplemented makes implementer into NotImplementedError type
|
||||
|
@ -490,11 +478,6 @@ func NotImplementedErrorf(format string, params ...interface{}) error {
|
|||
return notImpl(fmt.Sprintf(format, params...))
|
||||
}
|
||||
|
||||
// TimeoutErrorf creates an instance of TimeoutError
|
||||
func TimeoutErrorf(format string, params ...interface{}) error {
|
||||
return timeout(fmt.Sprintf(format, params...))
|
||||
}
|
||||
|
||||
// InternalErrorf creates an instance of InternalError
|
||||
func InternalErrorf(format string, params ...interface{}) error {
|
||||
return internal(fmt.Sprintf(format, params...))
|
||||
|
@ -505,11 +488,6 @@ func InternalMaskableErrorf(format string, params ...interface{}) error {
|
|||
return maskInternal(fmt.Sprintf(format, params...))
|
||||
}
|
||||
|
||||
// RetryErrorf creates an instance of RetryError
|
||||
func RetryErrorf(format string, params ...interface{}) error {
|
||||
return retry(fmt.Sprintf(format, params...))
|
||||
}
|
||||
|
||||
/***********************
|
||||
* Internal Error Types
|
||||
***********************/
|
||||
|
@ -541,13 +519,6 @@ func (ns noService) Error() string {
|
|||
}
|
||||
func (ns noService) NoService() {}
|
||||
|
||||
type timeout string
|
||||
|
||||
func (to timeout) Error() string {
|
||||
return string(to)
|
||||
}
|
||||
func (to timeout) Timeout() {}
|
||||
|
||||
type notImpl string
|
||||
|
||||
func (ni notImpl) Error() string {
|
||||
|
@ -569,10 +540,3 @@ func (mnt maskInternal) Error() string {
|
|||
}
|
||||
func (mnt maskInternal) Internal() {}
|
||||
func (mnt maskInternal) Maskable() {}
|
||||
|
||||
type retry string
|
||||
|
||||
func (r retry) Error() string {
|
||||
return string(r)
|
||||
}
|
||||
func (r retry) Retry() {}
|
||||
|
|
|
@ -19,17 +19,6 @@ func TestErrorConstructors(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
err = RetryErrorf("Incy wincy %s went up the spout again", "spider")
|
||||
if err.Error() != "Incy wincy spider went up the spout again" {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, ok := err.(RetryError); !ok {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, ok := err.(MaskableError); ok {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
err = NotFoundErrorf("Can't find the %s", "keys")
|
||||
if err.Error() != "Can't find the keys" {
|
||||
t.Fatal(err)
|
||||
|
@ -63,17 +52,6 @@ func TestErrorConstructors(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
err = TimeoutErrorf("Process %s timed out", "abc")
|
||||
if err.Error() != "Process abc timed out" {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, ok := err.(TimeoutError); !ok {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, ok := err.(MaskableError); ok {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
err = NoServiceErrorf("Driver %s is not available", "mh")
|
||||
if err.Error() != "Driver mh is not available" {
|
||||
t.Fatal(err)
|
||||
|
|
Loading…
Add table
Reference in a new issue