Skip to content

Commit

Permalink
refactor(middleware/session): Simplify error handling in DefaultError…
Browse files Browse the repository at this point in the history
…Handler
  • Loading branch information
sixcolors committed Oct 2, 2024
1 parent 00b9e07 commit 23e823b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions middleware/session/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,8 @@ var ConfigDefault = Config{
// DefaultErrorHandler(c, err)
func DefaultErrorHandler(c fiber.Ctx, err error) {
log.Errorf("session: %v", err)
if c != nil {
if sendErr := (c).SendStatus(fiber.StatusInternalServerError); sendErr != nil {
log.Errorf("session: %v", sendErr)
}
if sendErr := (c).SendStatus(fiber.StatusInternalServerError); sendErr != nil {
log.Errorf("session: %v", sendErr)

Check warning on line 129 in middleware/session/config.go

View check run for this annotation

Codecov / codecov/patch

middleware/session/config.go#L129

Added line #L129 was not covered by tests
}
}

Expand Down

0 comments on commit 23e823b

Please sign in to comment.