aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bridge/core/bridge.go2
-rw-r--r--bridge/core/import.go13
2 files changed, 12 insertions, 3 deletions
diff --git a/bridge/core/bridge.go b/bridge/core/bridge.go
index 1d0a4681..f606d2da 100644
--- a/bridge/core/bridge.go
+++ b/bridge/core/bridge.go
@@ -347,7 +347,7 @@ func (b *Bridge) ImportAllSince(ctx context.Context, since time.Time) (<-chan Im
// relay all events while checking that everything went well
for event := range events {
- if event.Err != nil {
+ if event.Event == ImportEventError {
noError = false
}
out <- event
diff --git a/bridge/core/import.go b/bridge/core/import.go
index 5f138da7..f0a6f0c8 100644
--- a/bridge/core/import.go
+++ b/bridge/core/import.go
@@ -2,6 +2,7 @@ package core
import (
"fmt"
+ "strings"
"github.com/MichaelMure/git-bug/entity"
)
@@ -74,10 +75,18 @@ func (er ImportResult) String() string {
}
return fmt.Sprintf("import error: %s", er.Err.Error())
case ImportEventWarning:
+ parts := make([]string, 0, 4)
+ parts = append(parts, "warning:")
if er.ID != "" {
- return fmt.Sprintf("warning at id %s: %s", er.ID, er.Err.Error())
+ parts = append(parts, fmt.Sprintf("at id %s", er.ID))
}
- return fmt.Sprintf("warning: %s", er.Err.Error())
+ if er.Reason != "" {
+ parts = append(parts, fmt.Sprintf("reason: %s", er.Reason))
+ }
+ if er.Err != nil {
+ parts = append(parts, fmt.Sprintf("err: %s", er.Err))
+ }
+ return strings.Join(parts, " ")
default:
panic("unknown import result")