Improve error handling for outputEntries
This commit is contained in:
parent
e6c4095e78
commit
4f8b167e7d
16
main.go
16
main.go
|
@ -29,19 +29,23 @@ func main() {
|
|||
|
||||
items = filterEntriesAfter(items, now.With(time.Now()).Monday())
|
||||
|
||||
outputEntries(items)
|
||||
}
|
||||
|
||||
func outputEntries(items []microsub.Item) {
|
||||
t, err := template.ParseFiles("templates/weekly.html")
|
||||
err = outputEntries(items)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func outputEntries(items []microsub.Item) error {
|
||||
t, err := template.ParseFiles("templates/weekly.html")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = t.Execute(os.Stdout, items)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func getEntriesForFeed(u *url.URL) ([]microsub.Item, error) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user