unified API error response

This commit is contained in:
Unknwon 2015-10-08 20:36:07 -04:00
parent b1941f1da1
commit aff49b1c9e
13 changed files with 61 additions and 67 deletions

View file

@ -95,7 +95,7 @@ func Toggle(options *ToggleOptions) macaron.Handler {
if !ctx.IsSigned {
// Restrict API calls with error message.
if auth.IsAPIPath(ctx.Req.URL.Path) {
ctx.HandleAPI(403, "Only signed in user is allowed to call APIs.")
ctx.APIError(403, "", "Only signed in user is allowed to call APIs.")
return
}