Skip to content

Commit

Permalink
feat(handler/session): reduce logging level for not found errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tronghn committed Nov 2, 2023
1 parent b412502 commit e3022c7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,13 @@ func (s *Standalone) Wildcard(w http.ResponseWriter, r *http.Request) {
func handleGetSessionError(route string, w http.ResponseWriter, r *http.Request, err error) {
logger := mw.LogEntryFrom(r)

if errors.Is(err, session.ErrInvalid) || errors.Is(err, session.ErrNotFound) {
if errors.Is(err, session.ErrNotFound) {
logger.Debugf("%s: getting session: %+v", route, err)
w.WriteHeader(http.StatusUnauthorized)
return
}

if errors.Is(err, session.ErrInvalid) {
logger.Infof("%s: getting session: %+v", route, err)
w.WriteHeader(http.StatusUnauthorized)
return
Expand Down

0 comments on commit e3022c7

Please sign in to comment.