summaryrefslogtreecommitdiffstats
path: root/modules/middleware/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/middleware/context.go')
-rw-r--r--modules/middleware/context.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/middleware/context.go b/modules/middleware/context.go
index 31fdca681a..e9084d330c 100644
--- a/modules/middleware/context.go
+++ b/modules/middleware/context.go
@@ -79,6 +79,19 @@ func (ctx *Context) Query(name string) string {
// }
// HasError returns true if error occurs in form validation.
+func (ctx *Context) HasApiError() bool {
+ hasErr, ok := ctx.Data["HasError"]
+ if !ok {
+ return false
+ }
+ return hasErr.(bool)
+}
+
+func (ctx *Context) GetErrMsg() string {
+ return ctx.Data["ErrorMsg"].(string)
+}
+
+// HasError returns true if error occurs in form validation.
func (ctx *Context) HasError() bool {
hasErr, ok := ctx.Data["HasError"]
if !ok {