diff options
Diffstat (limited to 'bridge/core/export.go')
-rw-r--r-- | bridge/core/export.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bridge/core/export.go b/bridge/core/export.go index 0f45404c..4397a527 100644 --- a/bridge/core/export.go +++ b/bridge/core/export.go @@ -29,6 +29,10 @@ const ( // Error happened during export ExportEventError + + // Something wrong happened during export that is worth notifying to the user + // but not severe enough to consider the export a failure. + ExportEventWarning ) // ExportResult is an event that is emitted during the export process, to @@ -65,6 +69,11 @@ func (er ExportResult) String() string { return fmt.Sprintf("export error at %s: %s", er.ID, er.Err.Error()) } return fmt.Sprintf("export error: %s", er.Err.Error()) + case ExportEventWarning: + if er.ID != "" { + return fmt.Sprintf("warning at %s: %s", er.ID, er.Err.Error()) + } + return fmt.Sprintf("warning: %s", er.Err.Error()) default: panic("unknown export result") @@ -79,6 +88,14 @@ func NewExportError(err error, id entity.Id) ExportResult { } } +func NewExportWarning(err error, id entity.Id) ExportResult { + return ExportResult{ + ID: id, + Err: err, + Event: ExportEventWarning, + } +} + func NewExportNothing(id entity.Id, reason string) ExportResult { return ExportResult{ ID: id, |