aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/core/export.go
diff options
context:
space:
mode:
authorAmine <hilalyamine@gmail.com>2019-08-19 00:37:54 +0200
committerGitHub <noreply@github.com>2019-08-19 00:37:54 +0200
commit36c91adddfc16b8c5d04eb66dbb4cf8c25cea321 (patch)
tree50484f3531e33c2c63c026fcb1c76f60f8b13862 /bridge/core/export.go
parent6428352bd14828f670206b60862de7f71c52d235 (diff)
parente6931aaf6f3173c634b03d515287e4a12fd20f15 (diff)
downloadgit-bug-36c91adddfc16b8c5d04eb66dbb4cf8c25cea321.tar.gz
Merge pull request #190 from MichaelMure/bridge-ctx
Bridge: pull/push enhancements
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..ceae1401 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("no actions taken for event %s: %s", er.ID, er.Reason)
+ }
+ return fmt.Sprintf("no actions taken: %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")
}