diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/registry/errors.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/registry/errors.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/registry/errors.go b/vendor/github.com/hashicorp/terraform/registry/errors.go new file mode 100644 index 0000000..b8dcd31 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/registry/errors.go | |||
@@ -0,0 +1,23 @@ | |||
1 | package registry | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | |||
6 | "github.com/hashicorp/terraform/registry/regsrc" | ||
7 | ) | ||
8 | |||
9 | type errModuleNotFound struct { | ||
10 | addr *regsrc.Module | ||
11 | } | ||
12 | |||
13 | func (e *errModuleNotFound) Error() string { | ||
14 | return fmt.Sprintf("module %s not found", e.addr) | ||
15 | } | ||
16 | |||
17 | // IsModuleNotFound returns true only if the given error is a "module not found" | ||
18 | // error. This allows callers to recognize this particular error condition | ||
19 | // as distinct from operational errors such as poor network connectivity. | ||
20 | func IsModuleNotFound(err error) bool { | ||
21 | _, ok := err.(*errModuleNotFound) | ||
22 | return ok | ||
23 | } | ||