Skip to content

Commit

Permalink
🐛 Wrong error propagated when auto-resolving
Browse files Browse the repository at this point in the history
The mergeConflictError itself was propagated
instead of the error received from the
autoResolver. This might lead to confusing/misleading
error messages.
  • Loading branch information
AndreasSko committed Jul 24, 2023
1 parent 2054636 commit 24670b1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gomobile/Merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (dbw *DatabaseWrapper) MergeBookmarks(conflictSolver string, mcw *MergeConf
var resErr error
newSolutions, resErr := merger.AutoResolveConflicts(err.Conflicts, conflictSolver)
if resErr != nil {
return errors.Wrap(err, "Could not automatically solve conflicts for bookmarks")
return errors.Wrap(resErr, "Could not automatically solve conflicts for bookmarks")
}
addToSolutions(conflictSolution, newSolutions)
default:
Expand Down Expand Up @@ -76,7 +76,7 @@ func (dbw *DatabaseWrapper) MergeInputFields(conflictSolver string, mcw *MergeCo
var resErr error
newSolutions, resErr := merger.AutoResolveConflicts(err.Conflicts, conflictSolver)
if resErr != nil {
return errors.Wrap(err, "Could not automatically solve conflicts for inputFields")
return errors.Wrap(resErr, "Could not automatically solve conflicts for inputFields")
}
addToSolutions(conflictSolution, newSolutions)
default:
Expand Down Expand Up @@ -126,7 +126,7 @@ func (dbw *DatabaseWrapper) MergeUserMarkAndBlockRange(conflictSolver string, mc
var resErr error
newSolutions, resErr := merger.AutoResolveConflicts(err.Conflicts, conflictSolver)
if resErr != nil {
return errors.Wrap(err, "Could not automatically solve conflicts for markings")
return errors.Wrap(resErr, "Could not automatically solve conflicts for markings")
}
addToSolutions(conflictSolution, newSolutions)
default:
Expand Down Expand Up @@ -159,7 +159,7 @@ func (dbw *DatabaseWrapper) MergeNotes(conflictSolver string, mcw *MergeConflict
var resErr error
newSolutions, resErr := merger.AutoResolveConflicts(err.Conflicts, conflictSolver)
if resErr != nil {
return errors.Wrap(err, "Could not automatically solve conflicts for notes")
return errors.Wrap(resErr, "Could not automatically solve conflicts for notes")
}
addToSolutions(conflictSolution, newSolutions)
default:
Expand Down

0 comments on commit 24670b1

Please sign in to comment.