github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/pagerduty/errors.go (about)

     1  package pagerduty
     2  
     3  import "strings"
     4  
     5  func isNotFound(err error) bool {
     6  	if strings.Contains(err.Error(), "Failed call API endpoint. HTTP response code: 404") {
     7  		return true
     8  	}
     9  
    10  	return false
    11  }
    12  
    13  func isUnauthorized(err error) bool {
    14  	return strings.Contains(err.Error(), "HTTP response code: 401")
    15  }