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:
parent
a6f10edd56
commit
07d9bb5e99
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user