Skip to content

Commit

Permalink
Merge pull request #12 from qor/process-context-err
Browse files Browse the repository at this point in the history
process qor context error
  • Loading branch information
sunfmin authored Jul 15, 2019
2 parents 59574e5 + 4f3f445 commit 0f2e7ed
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,13 @@ func (res *Resource) Import(container Container, context *qor.Context, callbacks

if err = res.FindOneHandler(result, metaValues, context); err == nil || err == gorm.ErrRecordNotFound {
if err = resource.DecodeToResource(res, result, metaValues, context).Start(); err == nil {
if err = res.CallSave(result, context); err != nil {
handleError(err)
hasErr := context.HasError()
if !hasErr {
if err = res.CallSave(result, context); err != nil {
handleError(err)
}
} else {
handleError(context.Errors)
}
} else {
handleError(err)
Expand Down

0 comments on commit 0f2e7ed

Please sign in to comment.