Skip to content

Commit

Permalink
project_column: use github.ErrorResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
shihanng committed Sep 4, 2018
1 parent b545371 commit b5dcbb6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions github/resource_github_project_column.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package github

import (
"context"
"net/http"
"strconv"
"strings"

Expand Down Expand Up @@ -66,11 +67,13 @@ func resourceGithubProjectColumnRead(d *schema.ResourceData, meta interface{}) e
return unconvertibleIdErr(d.Id(), err)
}

column, resp, err := client.Projects.GetProjectColumn(context.TODO(), columnID)
column, _, err := client.Projects.GetProjectColumn(context.TODO(), columnID)
if err != nil {
if resp != nil && resp.StatusCode == 404 {
d.SetId("")
return nil
if err, ok := err.(*github.ErrorResponse); ok {
if err.Response.StatusCode == http.StatusNotFound {
d.SetId("")
return nil
}
}
return err
}
Expand Down

0 comments on commit b5dcbb6

Please sign in to comment.