diff --git a/cmd/storage-rest-client.go b/cmd/storage-rest-client.go index 936cb5434..20543d468 100644 --- a/cmd/storage-rest-client.go +++ b/cmd/storage-rest-client.go @@ -148,6 +148,8 @@ func toStorageErr(err error) error { return errDiskOngoingReq case grid.ErrUnknownHandler.Error(): return errInconsistentDisk + case grid.ErrDisconnected.Error(): + return errDiskNotFound } return err } diff --git a/internal/grid/connection.go b/internal/grid/connection.go index f761b9389..fb2d3f72e 100644 --- a/internal/grid/connection.go +++ b/internal/grid/connection.go @@ -1374,7 +1374,7 @@ func (c *Connection) handleDisconnectClientMux(m message) { if m.Flags&FlagPayloadIsErr != 0 { v.error(RemoteErr(m.Payload)) } else { - v.error("remote disconnected") + v.error(ErrDisconnected) } return } diff --git a/internal/grid/grid.go b/internal/grid/grid.go index 1cf9129d1..f54f6dab0 100644 --- a/internal/grid/grid.go +++ b/internal/grid/grid.go @@ -30,7 +30,7 @@ import ( ) // ErrDisconnected is returned when the connection to the remote has been lost during the call. -var ErrDisconnected = errors.New("remote disconnected") +var ErrDisconnected = RemoteErr("remote disconnected") const ( // minBufferSize is the minimum buffer size.