mirror of
https://github.com/labstack/echo.git
synced 2025-06-08 23:56:20 +02:00
Fixed panic messages
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
7c614588bc
commit
06189d002b
@ -54,7 +54,7 @@ func BasicAuth(fn BasicAuthValidator) echo.MiddlewareFunc {
|
|||||||
func BasicAuthWithConfig(config BasicAuthConfig) echo.MiddlewareFunc {
|
func BasicAuthWithConfig(config BasicAuthConfig) echo.MiddlewareFunc {
|
||||||
// Defaults
|
// Defaults
|
||||||
if config.Validator == nil {
|
if config.Validator == nil {
|
||||||
panic("basic-auth middleware requires a validator function")
|
panic("echo: basic-auth middleware requires a validator function")
|
||||||
}
|
}
|
||||||
if config.Skipper == nil {
|
if config.Skipper == nil {
|
||||||
config.Skipper = DefaultBasicAuthConfig.Skipper
|
config.Skipper = DefaultBasicAuthConfig.Skipper
|
||||||
|
@ -54,7 +54,7 @@ func BodyDump(handler BodyDumpHandler) echo.MiddlewareFunc {
|
|||||||
func BodyDumpWithConfig(config BodyDumpConfig) echo.MiddlewareFunc {
|
func BodyDumpWithConfig(config BodyDumpConfig) echo.MiddlewareFunc {
|
||||||
// Defaults
|
// Defaults
|
||||||
if config.Handler == nil {
|
if config.Handler == nil {
|
||||||
panic("body-dump middleware requires a handler function")
|
panic("echo: body-dump middleware requires a handler function")
|
||||||
}
|
}
|
||||||
if config.Skipper == nil {
|
if config.Skipper == nil {
|
||||||
config.Skipper = DefaultBodyDumpConfig.Skipper
|
config.Skipper = DefaultBodyDumpConfig.Skipper
|
||||||
|
@ -60,7 +60,7 @@ func BodyLimitWithConfig(config BodyLimitConfig) echo.MiddlewareFunc {
|
|||||||
|
|
||||||
limit, err := bytes.Parse(config.Limit)
|
limit, err := bytes.Parse(config.Limit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("invalid body-limit=%s", config.Limit))
|
panic(fmt.Errorf("echo: invalid body-limit=%s", config.Limit))
|
||||||
}
|
}
|
||||||
config.limit = limit
|
config.limit = limit
|
||||||
pool := limitedReaderPool(config)
|
pool := limitedReaderPool(config)
|
||||||
|
@ -72,7 +72,7 @@ func KeyAuthWithConfig(config KeyAuthConfig) echo.MiddlewareFunc {
|
|||||||
config.KeyLookup = DefaultKeyAuthConfig.KeyLookup
|
config.KeyLookup = DefaultKeyAuthConfig.KeyLookup
|
||||||
}
|
}
|
||||||
if config.Validator == nil {
|
if config.Validator == nil {
|
||||||
panic("key-auth middleware requires a validator function")
|
panic("echo: key-auth middleware requires a validator function")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize
|
// Initialize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user