From 07d9bb5e99f0f9a25c0b1d0dd4ccb23c288f65ce Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Sun, 5 Aug 2018 11:10:02 -0700 Subject: [PATCH] Don't die if Todoist can't connect to the API --- todoist/project.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/todoist/project.go b/todoist/project.go index 15895abb..7c52fa9f 100644 --- a/todoist/project.go +++ b/todoist/project.go @@ -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,