1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Don't die if Todoist can't connect to the API

This commit is contained in:
Chris Cummer 2018-08-05 11:10:02 -07:00
parent a6f10edd56
commit 07d9bb5e99

View File

@ -14,10 +14,12 @@ type Project struct {
}
func NewProject(id int) *Project {
// Todoist seems to experience a lot of network issues on their side
// If we can't connect, handle it with an empty project until we can
project, err := todoist.GetProject(id)
if err != nil {
panic(err)
}
if err != nil {
return &Project{}
}
proj := &Project{
Project: project,