Skip to content

Commit

Permalink
Merge pull request #186 from Dash-Industry-Forum/more-logging
Browse files Browse the repository at this point in the history
logging error details when generating segments
  • Loading branch information
tobbee authored May 21, 2024
2 parents f09c960 + 2ffb323 commit 6e9bc68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Nothing yet
### Added

- More error logging for segment generation.

## [1.3.1] - 2024-05-08

Expand Down
10 changes: 4 additions & 6 deletions cmd/livesim2/app/handler_livesim.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ func (s *Server) livesimHandlerFunc(w http.ResponseWriter, r *http.Request) {
cfg.SetHost(s.Cfg.Host, r)
err := writeLiveMPD(log, w, cfg, a, mpdName, nowMS)
if err != nil {
msg := fmt.Sprintf("liveMPD: %s", err)
log.Error(msg)
http.Error(w, msg, http.StatusInternalServerError)
log.Error("liveMPD", "err", err)
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
case ".mp4", ".m4s", ".cmfv", ".cmfa", ".cmft", ".jpg", ".jpeg", ".m4v", ".m4a":
Expand Down Expand Up @@ -129,6 +128,7 @@ func (s *Server) livesimHandlerFunc(w http.ResponseWriter, r *http.Request) {
}
code, err := writeSegment(r.Context(), w, log, cfg, s.assetMgr.vodFS, a, segmentPart[1:], nowMS, s.textTemplates)
if err != nil {
log.Error("writeSegment", "code", code, "err", err)
var tooEarly errTooEarly
switch {
case errors.Is(err, errNotFound):
Expand All @@ -139,9 +139,7 @@ func (s *Server) livesimHandlerFunc(w http.ResponseWriter, r *http.Request) {
case errors.Is(err, errGone):
http.Error(w, "Gone", http.StatusGone)
default:
msg := "writeSegment"
log.Error(msg)
http.Error(w, msg, http.StatusInternalServerError)
http.Error(w, "writeSegment", http.StatusInternalServerError)
return
}
}
Expand Down

0 comments on commit 6e9bc68

Please sign in to comment.