aboutsummaryrefslogtreecommitdiffstats
path: root/bug
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-19 21:41:46 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-19 21:45:52 +0200
commit1060acfd533c30ddcd31e4c0431d36e410e011e9 (patch)
treed919df90c38697741834f2fb8dda5f90ebc9ccea /bug
parent4c576470a8075c4752ab67573bbc64eaab69265b (diff)
downloadgit-bug-1060acfd533c30ddcd31e4c0431d36e410e011e9.tar.gz
bug: reclassify some merge error as "invalid" instead of hard error
Diffstat (limited to 'bug')
-rw-r--r--bug/bug_actions.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/bug/bug_actions.go b/bug/bug_actions.go
index 7f2194ab..8be4420f 100644
--- a/bug/bug_actions.go
+++ b/bug/bug_actions.go
@@ -5,6 +5,7 @@ import (
"strings"
"github.com/MichaelMure/git-bug/repository"
+ "github.com/pkg/errors"
)
// Fetch retrieve update from a remote
@@ -61,13 +62,13 @@ func MergeAll(repo repository.Repo, remote string) <-chan MergeResult {
remoteBug, err := readBug(repo, remoteRef)
if err != nil {
- out <- newMergeError(err, id)
+ out <- newMergeInvalidStatus(id, errors.Wrap(err, "remote bug is not readable").Error())
continue
}
// Check for error in remote data
if err := remoteBug.Validate(); err != nil {
- out <- newMergeInvalidStatus(id, err.Error())
+ out <- newMergeInvalidStatus(id, errors.Wrap(err, "remote bug is invalid").Error())
continue
}
@@ -95,14 +96,14 @@ func MergeAll(repo repository.Repo, remote string) <-chan MergeResult {
localBug, err := readBug(repo, localRef)
if err != nil {
- out <- newMergeError(err, id)
+ out <- newMergeError(errors.Wrap(err, "local bug is not readable"), id)
return
}
updated, err := localBug.Merge(repo, remoteBug)
if err != nil {
- out <- newMergeError(err, id)
+ out <- newMergeInvalidStatus(id, errors.Wrap(err, "merge failed").Error())
return
}