From 9883f177dca224f08b36b19ce3b6cd65534ee468 Mon Sep 17 00:00:00 2001 From: wgwntp <593034713@qq.com> Date: Thu, 1 Aug 2019 11:03:06 +0800 Subject: [PATCH] Fix job error report not working and set job status to expection if any error occured --- exchange.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/exchange.go b/exchange.go index 460afbf..20f06ab 100644 --- a/exchange.go +++ b/exchange.go @@ -125,18 +125,19 @@ func (res *Resource) Import(container Container, context *qor.Context, callbacks if errors, ok := err.(errorsInterface); ok { for _, err := range errors.GetErrors() { handleError(err) + } - } else if err, ok := err.(*validations.Error); ok { + } else if errValidations, ok := err.(*validations.Error); ok { for idx, cell := range progress.Cells { - if cell.Header == err.Column { - cell.Error = err + if cell.Header == errValidations.Column { + cell.Error = errValidations progress.Cells[idx] = cell break } } } else if len(progress.Cells) > 0 { var err error = err - cell := progress.Cells[0] + cell := &progress.Cells[0] if cell.Error != nil { var errors qor.Errors errors.AddError(cell.Error)