always return after errors.
This commit is contained in:
1 parent
0688050552
commit
76e9ebde36
2 files changed
+2
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user