Fix error handling in DeleteFileBulk storage handler (#8327)

errors.errorString() cannot be marshalled by gob
encoder, so using a slice of []error would fail
to be encoded. This leads to no errors being
generated instead gob.Decoder on the storage-client
would see an io.EOF

To avoid such bugs introduce a typed error for
handling such translations and register this type
for gob encoding support.
This commit is contained in:
Harshavardhana
2019-09-30 19:01:28 -07:00
committed by GitHub
parent 4ec9b349d0
commit f45977d371
3 changed files with 27 additions and 23 deletions

View File

@@ -37,6 +37,7 @@ func init() {
logger.Init(GOPATH, GOROOT)
logger.RegisterUIError(fmtError)
gob.Register(HashMismatchError{})
gob.Register(DeleteFileError(""))
}
// ServerFlags - server command specific flags