Skip to content

Ignore 200 status also ignores 500 #40

@taraktikos

Description

@taraktikos

In case of adding this filter:

Filters:          []slogecho.Filter{slogecho.IgnoreStatus(200)},

When we just return an error without changing status c.Respnse().Status is 200

But inside logger we have the following:

var httpErr *echo.HTTPError
if err != nil && errors.As(err, &httpErr) {
    status = httpErr.Code
    if msg, ok := httpErr.Message.(string); ok {
	errMsg = errors.New(msg)
    }
}
.....

for _, filter := range config.Filters {
     if !filter(c) { // <- here we pass old status 200
	  return
     }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions