2015-10-02 03:24:38 +02:00
|
|
|
---
|
|
|
|
title: Customization
|
|
|
|
menu:
|
|
|
|
main:
|
|
|
|
parent: guide
|
2015-10-02 20:23:52 +02:00
|
|
|
weight: 20
|
2015-10-02 03:24:38 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
### HTTP error handler
|
|
|
|
|
|
|
|
`Echo.SetHTTPErrorHandler(h HTTPErrorHandler)`
|
|
|
|
|
|
|
|
Registers a custom `Echo.HTTPErrorHandler`.
|
|
|
|
|
|
|
|
Default handler rules
|
|
|
|
|
|
|
|
- If error is of type `Echo.HTTPError` it sends HTTP response with status code `HTTPError.Code`
|
|
|
|
and message `HTTPError.Message`.
|
|
|
|
- Else it sends `500 - Internal Server Error`.
|
|
|
|
- If debug mode is enabled, it uses `error.Error()` as status message.
|
|
|
|
|
|
|
|
### Debug
|
|
|
|
|
|
|
|
`Echo.SetDebug(on bool)`
|
|
|
|
|
|
|
|
Enables/disables debug mode.
|
|
|
|
|
|
|
|
### Disable colored log
|
|
|
|
|
|
|
|
`Echo.DisableColoredLog()`
|
|
|
|
|
|
|
|
### StripTrailingSlash
|
|
|
|
|
|
|
|
StripTrailingSlash enables removing trailing slash from the request path.
|
|
|
|
|
|
|
|
`e.StripTrailingSlash()`
|