Mercurial > gemma
changeset 5143:733f7136a30e
Do not mask error with subsequent error on commit
If an error occured during the transaction, COMMIT will always return
an error.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Tue, 31 Mar 2020 15:30:23 +0200 |
parents | ea22d3efa76c |
children | f11b9b50fcc9 |
files | pkg/imports/wfsjob.go |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/pkg/imports/wfsjob.go Tue Mar 31 14:17:58 2020 +0200 +++ b/pkg/imports/wfsjob.go Tue Mar 31 15:30:23 2020 +0200 @@ -311,8 +311,10 @@ sgc.releaseStmts() sgc.tx = nil sgc.ctx = nil - if err2 := tx.Commit(); err2 != nil { - // A real error on commit overrules the first. + if err2 := tx.Commit(); err2 != nil && + (err == nil || err == ErrFeaturesUnmodified) { + // An error on commit that is not induced by the first + // overrules the first. err = err2 } }