Change the comments on MustRender , now it renders a message instead of panic

This commit is contained in:
Gerasimos Maropoulos 2016-10-15 20:57:52 +03:00
parent 89abc3349d
commit e5547f7102

View File

@ -659,8 +659,7 @@ func (ctx *Context) Render(name string, binding interface{}, options ...map[stri
return ctx.RenderWithStatus(errCode, name, binding, options...) return ctx.RenderWithStatus(errCode, name, binding, options...)
} }
// MustRender same as .Render but returns 500 internal server http status (error) if rendering fail // MustRender same as .Render but returns 503 service unavailable http status with a (html) message if render failed
// builds up the response from the specified template or a serialize engine.
// Note: the options: "gzip" and "charset" are built'n support by Iris, so you can pass these on any template engine or serialize engine // Note: the options: "gzip" and "charset" are built'n support by Iris, so you can pass these on any template engine or serialize engine
func (ctx *Context) MustRender(name string, binding interface{}, options ...map[string]interface{}) { func (ctx *Context) MustRender(name string, binding interface{}, options ...map[string]interface{}) {
if err := ctx.Render(name, binding, options...); err != nil { if err := ctx.Render(name, binding, options...); err != nil {