Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Commit

Permalink
Handle hook 404
Browse files Browse the repository at this point in the history
  • Loading branch information
tprobinson committed Jul 18, 2018
1 parent 10368b2 commit 087de28
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bitbucket/resource_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ func resourceHookExists(d *schema.ResourceData, m interface{}) (bool, error) {
))

if err != nil {
log.Printf("[DEBUG] Req: %+v, Err: %+v", hook_req, err)
// If the hook was not found, we get the message "is not a valid hook".
// Return nil so we can show that the hook is gone.
if hook_req.StatusCode == 404 {
return false, nil
}

panic(err)
}

Expand Down

0 comments on commit 087de28

Please sign in to comment.