Proposed Dump function.

This commit is contained in:
Michael 2014-07-08 11:11:18 -05:00
parent c224bf8211
commit 8419489349

8
gin.go
View File

@ -327,6 +327,14 @@ func (c *Context) Fail(code int, err error) {
c.Abort(code)
}
// Dump is the same as Fail except instead of an error
// you are able to dump out any data that you may need to
// trouble shoot for your application.
func (c *Context) Dump(code int, dump interface) {
c.Writer.Write([]byte(fmt.Sprint("%v", dump)))
c.Abort(code)
}
func (c *Context) ErrorTyped(err error, typ uint32, meta interface{}) {
c.Errors = append(c.Errors, errorMsg{
Err: err.Error(),