[#300] Update error log record in DeleteMultipleObjects
Some checks failed
/ DCO (pull_request) Successful in 1m28s
/ Builds (1.20) (pull_request) Successful in 2m11s
/ Builds (1.21) (pull_request) Successful in 1m32s
/ Vulncheck (pull_request) Successful in 2m23s
/ Lint (pull_request) Failing after 2m49s
/ Tests (1.20) (pull_request) Successful in 2m33s
/ Tests (1.21) (pull_request) Successful in 2m28s
Some checks failed
/ DCO (pull_request) Successful in 1m28s
/ Builds (1.20) (pull_request) Successful in 2m11s
/ Builds (1.21) (pull_request) Successful in 1m32s
/ Vulncheck (pull_request) Successful in 2m23s
/ Lint (pull_request) Failing after 2m49s
/ Tests (1.20) (pull_request) Successful in 2m33s
/ Tests (1.21) (pull_request) Successful in 2m28s
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
This commit is contained in:
parent
cc34f659d1
commit
fb6bf25b0d
1 changed files with 3 additions and 1 deletions
|
@ -231,6 +231,7 @@ func (h *handler) DeleteMultipleObjectsHandler(w http.ResponseWriter, r *http.Re
|
||||||
deletedObjects := h.obj.DeleteObjects(ctx, p)
|
deletedObjects := h.obj.DeleteObjects(ctx, p)
|
||||||
|
|
||||||
var errs []error
|
var errs []error
|
||||||
|
var errObjects []string
|
||||||
for _, obj := range deletedObjects {
|
for _, obj := range deletedObjects {
|
||||||
if obj.Error != nil {
|
if obj.Error != nil {
|
||||||
code := "BadRequest"
|
code := "BadRequest"
|
||||||
|
@ -244,6 +245,7 @@ func (h *handler) DeleteMultipleObjectsHandler(w http.ResponseWriter, r *http.Re
|
||||||
VersionID: obj.VersionID,
|
VersionID: obj.VersionID,
|
||||||
})
|
})
|
||||||
errs = append(errs, obj.Error)
|
errs = append(errs, obj.Error)
|
||||||
|
errObjects = append(errObjects, obj.String())
|
||||||
} else if !requested.Quiet {
|
} else if !requested.Quiet {
|
||||||
deletedObj := DeletedObject{
|
deletedObj := DeletedObject{
|
||||||
ObjectIdentifier: ObjectIdentifier{
|
ObjectIdentifier: ObjectIdentifier{
|
||||||
|
@ -260,7 +262,7 @@ func (h *handler) DeleteMultipleObjectsHandler(w http.ResponseWriter, r *http.Re
|
||||||
}
|
}
|
||||||
if len(errs) != 0 {
|
if len(errs) != 0 {
|
||||||
fields := []zap.Field{
|
fields := []zap.Field{
|
||||||
zap.Array("objects", marshaler),
|
zap.Strings("objects", errObjects),
|
||||||
zap.Errors("errors", errs),
|
zap.Errors("errors", errs),
|
||||||
}
|
}
|
||||||
h.reqLogger(ctx).Error(logs.CouldntDeleteObjects, fields...)
|
h.reqLogger(ctx).Error(logs.CouldntDeleteObjects, fields...)
|
||||||
|
|
Loading…
Reference in a new issue