From 06189d002bc522702e76fba0514b24eb311a6869 Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Thu, 22 Jun 2017 22:48:23 -0700 Subject: [PATCH] Fixed panic messages Signed-off-by: Vishal Rana --- middleware/basic_auth.go | 2 +- middleware/body_dump.go | 2 +- middleware/body_limit.go | 2 +- middleware/key_auth.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/middleware/basic_auth.go b/middleware/basic_auth.go index c1f34c8f..8ff3d9f6 100644 --- a/middleware/basic_auth.go +++ b/middleware/basic_auth.go @@ -54,7 +54,7 @@ func BasicAuth(fn BasicAuthValidator) echo.MiddlewareFunc { func BasicAuthWithConfig(config BasicAuthConfig) echo.MiddlewareFunc { // Defaults 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 { config.Skipper = DefaultBasicAuthConfig.Skipper diff --git a/middleware/body_dump.go b/middleware/body_dump.go index 6d955346..88b75ee1 100644 --- a/middleware/body_dump.go +++ b/middleware/body_dump.go @@ -54,7 +54,7 @@ func BodyDump(handler BodyDumpHandler) echo.MiddlewareFunc { func BodyDumpWithConfig(config BodyDumpConfig) echo.MiddlewareFunc { // Defaults 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 { config.Skipper = DefaultBodyDumpConfig.Skipper diff --git a/middleware/body_limit.go b/middleware/body_limit.go index a2ff8d62..08f9083b 100644 --- a/middleware/body_limit.go +++ b/middleware/body_limit.go @@ -60,7 +60,7 @@ func BodyLimitWithConfig(config BodyLimitConfig) echo.MiddlewareFunc { limit, err := bytes.Parse(config.Limit) 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 pool := limitedReaderPool(config) diff --git a/middleware/key_auth.go b/middleware/key_auth.go index 5ef87e3d..24625260 100644 --- a/middleware/key_auth.go +++ b/middleware/key_auth.go @@ -72,7 +72,7 @@ func KeyAuthWithConfig(config KeyAuthConfig) echo.MiddlewareFunc { config.KeyLookup = DefaultKeyAuthConfig.KeyLookup } if config.Validator == nil { - panic("key-auth middleware requires a validator function") + panic("echo: key-auth middleware requires a validator function") } // Initialize