mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 17:48:51 +02:00
fix:#3 added error key in slog
This commit is contained in:
@ -45,7 +45,7 @@ func ClearFeeds(db *daos.Dao, months int, clock localTime.Clock) {
|
||||
sqlResult, err = db.DB().Delete("feeds", dbx.NewExp("id = {:id}", dbx.Params{"id": feed.GetId()})).Execute()
|
||||
if err != nil {
|
||||
slog.Error("CleanFeeds: delete feed "+feed.GetId()+" failed", "error", err)
|
||||
slog.Error("SQL Result: ", sqlResult)
|
||||
slog.Error("SQL Result: ", "error", sqlResult)
|
||||
} else {
|
||||
slog.Info("CleanFeeds: delete feed " + feed.GetId() + " successful")
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -81,14 +81,14 @@ func FetchSeminarGroups(app *pocketbase.PocketBase) ([]*models.Record, error) {
|
||||
|
||||
collection, dbError := db.FindCollection(app, "groups")
|
||||
if dbError != nil {
|
||||
slog.Error("Error while searching collection groups", dbError)
|
||||
slog.Error("Error while searching collection groups", "error", dbError)
|
||||
return nil, err
|
||||
}
|
||||
var insertedGroups []*models.Record
|
||||
|
||||
insertedGroups, dbError = db.SaveGroups(groups, collection, app)
|
||||
if dbError != nil {
|
||||
slog.Error("Error while saving groups", dbError)
|
||||
slog.Error("Error while saving groups", "error", dbError)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user