DefaultHTTPErrorHandler default exception handler
(ctx Context, err error)
| 654 | |
| 655 | // DefaultHTTPErrorHandler default exception handler |
| 656 | func (app *DotWeb) DefaultHTTPErrorHandler(ctx Context, err error) { |
| 657 | ctx.Response().Header().Set(HeaderContentType, CharsetUTF8) |
| 658 | // if in development mode, output the error info |
| 659 | if app.IsDevelopmentMode() { |
| 660 | stack := string(debug.Stack()) |
| 661 | ctx.WriteStringC(http.StatusInternalServerError, fmt.Sprintln(err)+stack) |
| 662 | } else { |
| 663 | ctx.WriteStringC(http.StatusInternalServerError, "Internal Server Error") |
| 664 | } |
| 665 | } |
| 666 | |
| 667 | func (app *DotWeb) printDotLogo() { |
| 668 | app.Logger().Print(` ____ __ __`, LogTarget_HttpServer) |
nothing calls this directly
no test coverage detected