aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/core/export.go
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/core/export.go')
-rw-r--r--bridge/core/export.go24
1 files changed, 17 insertions, 7 deletions
diff --git a/bridge/core/export.go b/bridge/core/export.go
index 09566b62..55cf5a60 100644
--- a/bridge/core/export.go
+++ b/bridge/core/export.go
@@ -17,6 +17,7 @@ const (
ExportEventTitleEdition
ExportEventLabelChange
ExportEventNothing
+ ExportEventError
)
// ExportResult is an event that is emitted during the export process, to
@@ -32,19 +33,28 @@ type ExportResult struct {
func (er ExportResult) String() string {
switch er.Event {
case ExportEventBug:
- return "new issue"
+ return fmt.Sprintf("new issue: %s", er.ID)
case ExportEventComment:
- return "new comment"
+ return fmt.Sprintf("new comment: %s", er.ID)
case ExportEventCommentEdition:
- return "updated comment"
+ return fmt.Sprintf("updated comment: %s", er.ID)
case ExportEventStatusChange:
- return "changed status"
+ return fmt.Sprintf("changed status: %s", er.ID)
case ExportEventTitleEdition:
- return "changed title"
+ return fmt.Sprintf("changed title: %s", er.ID)
case ExportEventLabelChange:
- return "changed label"
+ return fmt.Sprintf("changed label: %s", er.ID)
case ExportEventNothing:
- return fmt.Sprintf("no event: %v", er.Reason)
+ if er.ID != "" {
+ return fmt.Sprintf("ignoring export event %s: %s", er.ID, er.Reason)
+ }
+ return fmt.Sprintf("ignoring export event: %s", er.Reason)
+ case ExportEventError:
+ if er.ID != "" {
+ return fmt.Sprintf("export error at %s: %s", er.ID, er.Err.Error())
+ }
+ return fmt.Sprintf("export error: %s", er.Err.Error())
+
default:
panic("unknown export result")
}