From ee48aef489c91a99b665ab1cd783e241611a3841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Sat, 4 Jan 2020 13:10:53 +0100 Subject: [PATCH] github: warning when the comment to be edited is missing instead of failing fix #286 --- bridge/github/import.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bridge/github/import.go b/bridge/github/import.go index dfc851fded10d571eb38a9432ed058a63471d98a..39aebccb9a0c6d246d4be633b4902cf222da4932 100644 --- a/bridge/github/import.go +++ b/bridge/github/import.go @@ -201,6 +201,11 @@ func (gi *githubImporter) ensureIssue(repo *cache.RepoCache, issue issueTimeline // other edits will be added as CommentEdit operations target, err := b.ResolveOperationWithMetadata(metaKeyGithubId, parseId(issue.Id)) + if err == cache.ErrNoMatchingOp { + // original comment is missing somehow, issuing a warning + gi.out <- core.NewImportWarning(fmt.Errorf("comment ID %s to edit is missing", parseId(issue.Id)), b.Id()) + continue + } if err != nil { return nil, err }