forked from TrueCloudLab/frostfs-sdk-go
[#269] client: Fix response processing of Object.Put
rpc
After 85e3c7b087
`processResponse` method
sets `err` field or sets status in `statusRes` field of `contextCall`.
In previous implementation `ObjectWriter.Close` method returned
`ctxCall.err` on `false` return of `processResponse` method. This could
cause NPE-panic if status failure resolving was disabled.
Make `ObjectWriter.Close` to return internal `err` field only if it is
set, otherwise return status response.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
eb3b990812
commit
ea21cdf731
1 changed files with 3 additions and 1 deletions
|
@ -187,7 +187,9 @@ func (x *ObjectWriter) Close() (*ResObjectPut, error) {
|
||||||
return nil, x.ctxCall.err
|
return nil, x.ctxCall.err
|
||||||
}
|
}
|
||||||
|
|
||||||
if !x.ctxCall.processResponse() {
|
x.ctxCall.processResponse()
|
||||||
|
|
||||||
|
if x.ctxCall.err != nil {
|
||||||
return nil, x.ctxCall.err
|
return nil, x.ctxCall.err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue