summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/notification.go10
-rw-r--r--routers/api/v1/notify/repo.go2
-rw-r--r--routers/api/v1/notify/threads.go4
3 files changed, 11 insertions, 5 deletions
diff --git a/models/notification.go b/models/notification.go
index ce656f4355..48249ae84c 100644
--- a/models/notification.go
+++ b/models/notification.go
@@ -434,7 +434,13 @@ func (n *Notification) loadComment(e db.Engine) (err error) {
if n.Comment == nil && n.CommentID != 0 {
n.Comment, err = getCommentByID(e, n.CommentID)
if err != nil {
- return fmt.Errorf("GetCommentByID [%d] for issue ID [%d]: %v", n.CommentID, n.IssueID, err)
+ if IsErrCommentNotExist(err) {
+ return ErrCommentNotExist{
+ ID: n.CommentID,
+ IssueID: n.IssueID,
+ }
+ }
+ return err
}
}
return nil
@@ -488,7 +494,7 @@ type NotificationList []*Notification
func (nl NotificationList) LoadAttributes() (err error) {
for i := 0; i < len(nl); i++ {
err = nl[i].LoadAttributes()
- if err != nil {
+ if err != nil && !IsErrCommentNotExist(err) {
return
}
}
diff --git a/routers/api/v1/notify/repo.go b/routers/api/v1/notify/repo.go
index 382d221b85..83d0fa5555 100644
--- a/routers/api/v1/notify/repo.go
+++ b/routers/api/v1/notify/repo.go
@@ -121,7 +121,7 @@ func ListRepoNotifications(ctx *context.APIContext) {
return
}
err = nl.LoadAttributes()
- if err != nil {
+ if err != nil && !models.IsErrCommentNotExist(err) {
ctx.InternalServerError(err)
return
}
diff --git a/routers/api/v1/notify/threads.go b/routers/api/v1/notify/threads.go
index 2e241080b4..5bfdd4d963 100644
--- a/routers/api/v1/notify/threads.go
+++ b/routers/api/v1/notify/threads.go
@@ -40,7 +40,7 @@ func GetThread(ctx *context.APIContext) {
if n == nil {
return
}
- if err := n.LoadAttributes(); err != nil {
+ if err := n.LoadAttributes(); err != nil && !models.IsErrCommentNotExist(err) {
ctx.InternalServerError(err)
return
}
@@ -92,7 +92,7 @@ func ReadThread(ctx *context.APIContext) {
ctx.InternalServerError(err)
return
}
- if err = notif.LoadAttributes(); err != nil {
+ if err = notif.LoadAttributes(); err != nil && !models.IsErrCommentNotExist(err) {
ctx.InternalServerError(err)
return
}