diff --git a/libnetwork/types/types.go b/libnetwork/types/types.go index 6982ff3019..e9702ba1ec 100644 --- a/libnetwork/types/types.go +++ b/libnetwork/types/types.go @@ -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() {} diff --git a/libnetwork/types/types_test.go b/libnetwork/types/types_test.go index b32a0007dd..77dbbe3516 100644 --- a/libnetwork/types/types_test.go +++ b/libnetwork/types/types_test.go @@ -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)