@@ -22,7 +22,7 @@ func promptOrganizationID(ctx context.Context) (string, error) {
22
22
Prompt : "Choose your default organization ID" ,
23
23
ValidateFunc : func (s string ) error {
24
24
if ! validation .IsUUID (s ) {
25
- return errors . New ( "organization id is not a valid uuid" )
25
+ return core . InvalidOrganizationIDError ( s )
26
26
}
27
27
return nil
28
28
},
@@ -38,7 +38,7 @@ func promptManualProjectID(ctx context.Context, defaultProjectID string) (string
38
38
DefaultValueDoc : defaultProjectID ,
39
39
ValidateFunc : func (s string ) error {
40
40
if ! validation .IsProjectID (s ) {
41
- return errors . New ( "organization id is not a valid uuid" )
41
+ return core . InvalidProjectIDError ( s )
42
42
}
43
43
return nil
44
44
},
@@ -146,7 +146,7 @@ func promptSecretKey(ctx context.Context) (string, error) {
146
146
if validation .IsSecretKey (s ) {
147
147
return nil
148
148
}
149
- return errors . New ( "invalid secret-key" )
149
+ return core . InvalidSecretKeyError ( s )
150
150
},
151
151
})
152
152
if err != nil {
@@ -158,7 +158,7 @@ func promptSecretKey(ctx context.Context) (string, error) {
158
158
return secret , nil
159
159
160
160
default :
161
- return "" , fmt . Errorf ( "invalid secret-key: '%v'" , secret )
161
+ return "" , core . InvalidSecretKeyError ( secret )
162
162
}
163
163
}
164
164
@@ -175,7 +175,7 @@ func promptAccessKey(ctx context.Context) (string, error) {
175
175
},
176
176
ValidateFunc : func (s string ) error {
177
177
if ! validation .IsAccessKey (s ) {
178
- return errors . New ( "invalid access-key" )
178
+ return core . InvalidAccessKeyError ( s )
179
179
}
180
180
181
181
return nil
@@ -190,7 +190,7 @@ func promptAccessKey(ctx context.Context) (string, error) {
190
190
return key , nil
191
191
192
192
default :
193
- return "" , fmt . Errorf ( "invalid access-key: '%v'" , key )
193
+ return "" , core . InvalidAccessKeyError ( key )
194
194
}
195
195
}
196
196
@@ -204,7 +204,7 @@ func promptDefaultZone(ctx context.Context) (scw.Zone, error) {
204
204
ValidateFunc : func (s string ) error {
205
205
logger .Debugf ("s: %v" , s )
206
206
if ! validation .IsZone (s ) {
207
- return errors . New ( "invalid zone" )
207
+ return core . InvalidZoneError ( s )
208
208
}
209
209
return nil
210
210
},
0 commit comments