diff --git a/context.go b/context.go index 4897fa36..89c925ec 100644 --- a/context.go +++ b/context.go @@ -369,15 +369,10 @@ func (c *Context) GetCookie(name string) (string, error) { func (c *Context) Render(code int, r render.Render) { c.Status(code) if err := r.Render(c.Writer); err != nil { - c.renderError(err) + panic(err) } } -func (c *Context) renderError(err error) { - debugPrintError(err) - c.AbortWithError(500, err).SetType(ErrorTypeRender) -} - // HTML renders the HTTP template specified by its file name. // It also updates the HTTP code and sets the Content-Type as "text/html". // See http://golang.org/doc/articles/wiki/ @@ -399,7 +394,7 @@ func (c *Context) IndentedJSON(code int, obj interface{}) { func (c *Context) JSON(code int, obj interface{}) { c.Status(code) if err := render.WriteJSON(c.Writer, obj); err != nil { - c.renderError(err) + panic(err) } }