Skip to content

Commit

Permalink
improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
frese committed Jun 26, 2020
1 parent f62cc52 commit 66f6734
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pd.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ func pdGetIncidentsSince(since time.Time) []pagerduty.Incident {

for ok := true; ok; ok = resp.APIListObject.More {
log.Printf("API query since: %s, Limit: %v Offset: %v", since, opts.APIListObject.Limit, opts.APIListObject.Offset)
resp, _ = pd.ListIncidents(opts)
resp, err := pd.ListIncidents(opts)
if err != nil {
log.Println("Error: Cannot list incidents from Pagerduty API:", err)
return incidents
}
log.Printf("Got %d incidents", len(resp.Incidents))
log.Printf("APIListObject %+v", resp.APIListObject)
incidents = append(incidents, resp.Incidents...)
Expand Down

0 comments on commit 66f6734

Please sign in to comment.