Verbessere Logging und Fehlerbehandlung
This commit is contained in:
parent
c737818ce4
commit
6e97d867de
14 changed files with 223 additions and 88 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"bytes"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"log"
|
||||
"officeHours/models"
|
||||
)
|
||||
|
||||
|
@ -84,7 +85,10 @@ func (b *BaseHandler) printTimetable(timetable map[models.Date]map[int]models.Of
|
|||
MinuteGranularity int
|
||||
DeleteIcons bool
|
||||
}{OfficeHour: current, MinuteGranularity: b.config.Date.MinuteGranularity, DeleteIcons: deleteIcons}
|
||||
Templates.ExecuteTemplate(&celldata, "td.html", data)
|
||||
templateError := Templates.ExecuteTemplate(&celldata, "td.html", data)
|
||||
if templateError != nil {
|
||||
log.Printf("Error executing template td.html: %s", templateError.Error())
|
||||
}
|
||||
tableBody += celldata.String()
|
||||
}
|
||||
} else {
|
||||
|
@ -116,6 +120,9 @@ func (b *BaseHandler) printTimetable(timetable map[models.Date]map[int]models.Of
|
|||
slots[4],
|
||||
template.HTML(tableBody),
|
||||
}
|
||||
Templates.ExecuteTemplate(&table, "officeHourTable.html", tableData)
|
||||
templateError := Templates.ExecuteTemplate(&table, "officeHourTable.html", tableData)
|
||||
if templateError != nil {
|
||||
log.Printf("Error executing template officeHourTable.html: %s", templateError.Error())
|
||||
}
|
||||
return template.HTML(table.String())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue