Skip to content

Commit

Permalink
Don't log warnings for events with no end time
Browse files Browse the repository at this point in the history
  • Loading branch information
brackendawson committed Sep 26, 2024
1 parent e680ada commit 7772785
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions calendar.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package server

import (
"context"
"errors"
"time"

ics "github.com/arran4/golang-ical"
Expand Down Expand Up @@ -54,6 +55,10 @@ func appendDay(ctx context.Context, s []Day, target time.Time, downstream *ics.C
}

if newEvent.EndTime, err = event.GetEndAt(); err != nil {
if errors.Is(err, ics.ErrorPropertyNotFound) {
log(ctx).Debugf("No event end time: %s", err) // TODO contribute a defined error here
continue
}
log(ctx).Warnf("Invalid event end time: %s", err) // TODO contribute a defined error here
continue
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.23
toolchain go1.23.0

require (
github.com/arran4/golang-ical v0.3.1
github.com/arran4/golang-ical v0.3.2-0.20240926133513-229e6a3f293f
github.com/gin-contrib/secure v1.1.0
github.com/gin-gonic/gin v1.10.0
github.com/hashicorp/go-uuid v1.0.3
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/arran4/golang-ical v0.3.1 h1:v13B3eQZ9VDHTAvT6M11vVzxYgcYmjyPBE2eAZl3VZk=
github.com/arran4/golang-ical v0.3.1/go.mod h1:LZWxF8ZIu/sjBVUCV0udiVPrQAgq3V0aa0RfbO99Qkk=
github.com/arran4/golang-ical v0.3.2-0.20240926133513-229e6a3f293f h1:5bd3/9u8rYA1/nSrmlJJsEZf0WePdcfVRtEqfFRqxsI=
github.com/arran4/golang-ical v0.3.2-0.20240926133513-229e6a3f293f/go.mod h1:xblDGxxIUMWwFZk9dlECUlc1iXNV65LJZOTHLVwu8bo=
github.com/bytedance/sonic v1.12.2 h1:oaMFuRTpMHYLpCntGca65YWt5ny+wAceDERTkT2L9lg=
github.com/bytedance/sonic v1.12.2/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk=
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
Expand Down

0 comments on commit 7772785

Please sign in to comment.