opentofu/builtin/providers/pagerduty/errors.go
Alexander ca517543f2 provider/pagerduty: Validate credentials (#12854)
* Validate credentials

* Add ability to skip validation

* Update provider documentation

* invalidCredentials -> invalidCreds

* Include original error message

* Update description for skip_credentials_validation

* Add config test

* set skip_credentials_validation default to false
2017-03-19 17:37:46 +00:00

16 lines
300 B
Go

package pagerduty
import "strings"
func isNotFound(err error) bool {
if strings.Contains(err.Error(), "Failed call API endpoint. HTTP response code: 404") {
return true
}
return false
}
func isUnauthorized(err error) bool {
return strings.Contains(err.Error(), "HTTP response code: 401")
}