summaryrefslogtreecommitdiffstats
path: root/modules/middleware/render.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/middleware/render.go')
-rw-r--r--modules/middleware/render.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/middleware/render.go b/modules/middleware/render.go
index 8a54183135..869ef9abaa 100644
--- a/modules/middleware/render.go
+++ b/modules/middleware/render.go
@@ -242,8 +242,11 @@ func (r *Render) HTMLString(name string, binding interface{}, htmlOpt ...HTMLOpt
}
}
-func (r *Render) Error(status int) {
+func (r *Render) Error(status int, message ...string) {
r.WriteHeader(status)
+ if len(message) > 0 {
+ r.Write([]byte(message[0]))
+ }
}
func (r *Render) Redirect(location string, status ...int) {