Skip to content

Commit

Permalink
Merge pull request #30 from strvcom/fix/error-logging
Browse files Browse the repository at this point in the history
fix: log error when terminating HTTP server
  • Loading branch information
TomasKocman committed Jul 10, 2023
2 parents aed39bf + 4eb7fe2 commit da2103d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ How to release a new version:

## [Unreleased]

## [0.6.2] - 2022-06-27
### Fixed
- Error logging when terminating HTTP server.

## [0.6.1] - 2022-03-28
### Changed
- package `http/param` does not zero the field if not tagged with any relevant tags
Expand Down Expand Up @@ -49,7 +53,8 @@ How to release a new version:
### Added
- Added Changelog.

[Unreleased]: https://github.com/strvcom/strv-backend-go-net/compare/v0.6.1...HEAD
[Unreleased]: https://github.com/strvcom/strv-backend-go-net/compare/v0.6.2...HEAD
[0.6.2]: https://github.com/strvcom/strv-backend-go-net/compare/v0.6.1...v0.6.2
[0.6.1]: https://github.com/strvcom/strv-backend-go-net/compare/v0.6.0...v0.6.1
[0.6.0]: https://github.com/strvcom/strv-backend-go-net/compare/v0.5.0...v0.6.0
[0.5.0]: https://github.com/strvcom/strv-backend-go-net/compare/v0.4.0...v0.5.0
Expand Down
4 changes: 2 additions & 2 deletions http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ func (s *Server) Run(ctx context.Context) error {
select {
case err := <-errCh:
if errors.Is(err, http.ErrServerClosed) {
s.logger.Error("server stopped: error received", err)
} else {
s.logger.Debug("server stopped: server closed")
} else {
s.logger.Error("server stopped: error received", err)
}
case <-ctx.Done():
s.logger.Error("server stopped: context closed", ctx.Err())
Expand Down

0 comments on commit da2103d

Please sign in to comment.