File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/pkg/cli/client/byoc/aws Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,18 @@ func (e ErrMissingAwsCreds) Unwrap() error {
74
74
return e .err
75
75
}
76
76
77
+ type ErrMissingAwsRegion struct {
78
+ err error
79
+ }
80
+
81
+ func (e ErrMissingAwsRegion ) Error () string {
82
+ return "missing AWS region: set AWS_REGION or edit your AWS profile (https://docs.defang.io/docs/providers/aws#region)"
83
+ }
84
+
85
+ func (e ErrMissingAwsRegion ) Unwrap () error {
86
+ return e .err
87
+ }
88
+
77
89
func AnnotateAwsError (err error ) error {
78
90
if err == nil {
79
91
return nil
@@ -82,6 +94,9 @@ func AnnotateAwsError(err error) error {
82
94
if strings .Contains (err .Error (), "get credentials:" ) {
83
95
return connect .NewError (connect .CodeUnauthenticated , ErrMissingAwsCreds {err })
84
96
}
97
+ if strings .Contains (err .Error (), "missing AWS region:" ) {
98
+ return connect .NewError (connect .CodeUnauthenticated , ErrMissingAwsRegion {err })
99
+ }
85
100
if cerr := new (aws.ErrNoSuchKey ); errors .As (err , & cerr ) {
86
101
return connect .NewError (connect .CodeNotFound , err )
87
102
}
You can’t perform that action at this time.
0 commit comments