From b7e3402995b4914026a13b44e505daa33f6e2fb1 Mon Sep 17 00:00:00 2001 From: ysqi Date: Wed, 1 Jun 2016 21:30:04 +0800 Subject: [PATCH] Sport Error exeception for outside --- error.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/error.go b/error.go index bad08d86..ce25d281 100644 --- a/error.go +++ b/error.go @@ -380,6 +380,11 @@ func ErrorController(c ControllerInterface) *App { return BeeApp } +// Exception Write HttpStatus with errCode and Exec error handler if exist. +func Exception(errCode uint64, ctx *context.Context) { + exception(strconv.FormatUint(errCode, 10), ctx) +} + // show error string as simple text message. // if error string is empty, show 503 or 500 error as default. func exception(errCode string, ctx *context.Context) {