always return after errors.

This commit is contained in:
woodsaj 2015-07-20 22:42:31 +08:00
parent 0688050552
commit 76e9ebde36
2 changed files with 2 additions and 0 deletions

View File

@ -91,6 +91,7 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) {
limitReached, err := m.QuotaReached(cmd.OrgId, m.QUOTA_DASHBOARD)
if err != nil {
c.JsonApiErr(500, "failed to get quota", err)
return
}
if limitReached {
c.JsonApiErr(403, "Quota reached", nil)

View File

@ -259,6 +259,7 @@ func LimitQuota(target m.QuotaTarget) macaron.Handler {
limitReached, err := m.QuotaReached(c.OrgId, target)
if err != nil {
c.JsonApiErr(500, "failed to get quota", err)
return
}
if limitReached {
c.JsonApiErr(403, "Quota reached", nil)