Skip to content

Commit

Permalink
Catch does not exist (404) for dashboard.
Browse files Browse the repository at this point in the history
  • Loading branch information
ojongerius committed Aug 6, 2015
1 parent 5818ff1 commit ebb876d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions datadog/resource_datadog_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"log"
"strconv"
"strings"

"github.com/hashicorp/terraform/helper/schema"
"github.com/zorkian/go-datadog-api"
Expand Down Expand Up @@ -99,6 +100,10 @@ func resourceDatadogDashboardExists(d *schema.ResourceData, meta interface{}) (b
_, err := client.GetDashboard(id)

if err != nil {
if strings.EqualFold(err.Error(), "API error: 404 Not Found") {
return false, nil
}

return false, fmt.Errorf("Error retrieving dashboard: %s", err)
}

Expand Down

0 comments on commit ebb876d

Please sign in to comment.