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
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
}
}
if n == nil {
return
}
- if err := n.LoadAttributes(); err != nil {
+ if err := n.LoadAttributes(); err != nil && !models.IsErrCommentNotExist(err) {
ctx.InternalServerError(err)
return
}
ctx.InternalServerError(err)
return
}
- if err = notif.LoadAttributes(); err != nil {
+ if err = notif.LoadAttributes(); err != nil && !models.IsErrCommentNotExist(err) {
ctx.InternalServerError(err)
return
}