fix:#3 added error key in slog

This commit is contained in:
Elmar Kresse
2024-05-26 22:47:32 +02:00
parent 1bac9bf187
commit 1267b37ab6
3 changed files with 7 additions and 6 deletions

View File

@@ -233,9 +233,10 @@ func getWeekEvents(start time.Time, end time.Time, cycle string) ([]time.Time, [
endI, endIErr = getDayInt(days[1])
if endIErr != nil || startIErr != nil {
slog.Error("Error while getting day int: "+days[0]+" - "+days[1]+" :", startIErr, endIErr)
slog.Error("Error while getting day int: "+days[0]+" - "+days[1]+" :", "error", startIErr)
slog.Error("Error while getting day int endErr: ", "error", endIErr)
} else {
//create a int array with all days from start to end day
//create an int array with all days from start to end day
var daysBetween []int
for i := startI; i <= endI; i++ {
daysBetween = append(daysBetween, i)
@@ -442,7 +443,7 @@ func htmlRequest(url string) (*goquery.Document, error) {
defer func(Body io.ReadCloser) {
readErr := Body.Close()
if readErr != nil {
slog.Error("Error while closing response body from html request", readErr)
slog.Error("Error while closing response body from html request", "error", readErr)
return
}
}(resp.Body)