diff options
Diffstat (limited to 'routers')
-rw-r--r-- | routers/user/notification.go | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/routers/user/notification.go b/routers/user/notification.go index d0ab3dbe88..74803f149e 100644 --- a/routers/user/notification.go +++ b/routers/user/notification.go @@ -81,24 +81,39 @@ func Notifications(c *context.Context) { return } - repos, err := notifications.LoadRepos() + failCount := 0 + + repos, failures, err := notifications.LoadRepos() if err != nil { c.ServerError("LoadRepos", err) return } + notifications = notifications.Without(failures) if err := repos.LoadAttributes(); err != nil { c.ServerError("LoadAttributes", err) return } + failCount += len(failures) - if err := notifications.LoadIssues(); err != nil { + failures, err = notifications.LoadIssues() + if err != nil { c.ServerError("LoadIssues", err) return } - if err := notifications.LoadComments(); err != nil { + notifications = notifications.Without(failures) + failCount += len(failures) + + failures, err = notifications.LoadComments() + if err != nil { c.ServerError("LoadComments", err) return } + notifications = notifications.Without(failures) + failCount += len(failures) + + if failCount > 0 { + c.Flash.Error(fmt.Sprintf("ERROR: %d notifications were removed due to missing parts - check the logs", failCount)) + } title := c.Tr("notifications") if status == models.NotificationStatusUnread && total > 0 { |