-
-
Notifications
You must be signed in to change notification settings - Fork 958
/
errors.go
42 lines (33 loc) · 1.19 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package terraform
import "fmt"
// MalformedRegistryURLErr is returned if the Terraform Registry URL passed to the Getter is malformed.
type MalformedRegistryURLErr struct {
reason string
}
func (err MalformedRegistryURLErr) Error() string {
return fmt.Sprintf("tfr getter URL is malformed: %s", err.reason)
}
// ServiceDiscoveryErr is returned if Terragrunt failed to identify the module API endpoint through the service
// discovery protocol.
type ServiceDiscoveryErr struct {
reason string
}
func (err ServiceDiscoveryErr) Error() string {
return fmt.Sprintf("Error identifying module registry API location: %s", err.reason)
}
// ModuleDownloadErr is returned if Terragrunt failed to download the module.
type ModuleDownloadErr struct {
sourceURL string
details string
}
func (err ModuleDownloadErr) Error() string {
return fmt.Sprintf("Error downloading module from %s: %s", err.sourceURL, err.details)
}
// RegistryAPIErr is returned if we get an unsuccessful HTTP return code from the registry.
type RegistryAPIErr struct {
url string
statusCode int
}
func (err RegistryAPIErr) Error() string {
return fmt.Sprintf("Failed to fetch url %s: status code %d", err.url, err.statusCode)
}