Skip to content

Commit 7466ea1

Browse files
Merge pull request #14 from laironacosta/feature/error-handler-echo
adding error custom response
2 parents 92eea16 + 1fb83fd commit 7466ea1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

middleware/echo/error_handler_middleware.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package middleware
22

33
import (
44
"github.com/labstack/echo/v4"
5-
e "github.com/laironacosta/kit-go/middleware"
5+
"github.com/laironacosta/kit-go/middleware/responses"
66
"github.com/pkg/errors"
77
"net/http"
88
)
@@ -31,7 +31,7 @@ func (h *ErrorHandlerMiddleware) HandlerError(next echo.HandlerFunc) echo.Handle
3131
var status int
3232
// Build the error response
3333
switch act := errors.Cause(err).(type) {
34-
case *e.GenericHttpError:
34+
case *responses.GenericHttpError:
3535
er = act.ErrorMsg
3636
erCode = act.ErrorCode
3737
status = act.Status

middleware/errors.go renamed to middleware/responses/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package errors
1+
package responses
22

33
// GenericHttpError is used to pass an error during the request through the application
44
type GenericHttpError struct {

0 commit comments

Comments
 (0)