Classify invalid delivery destinations during preflight
This commit is contained in:
@@ -66,11 +66,12 @@ type Asset struct {
|
||||
Handle any
|
||||
}
|
||||
|
||||
// PreflightFailureKind classifies a failure to verify credentials or access to
|
||||
// a delivery destination.
|
||||
// PreflightFailureKind classifies a failure to verify destination settings,
|
||||
// credentials, or repository access.
|
||||
type PreflightFailureKind string
|
||||
|
||||
const (
|
||||
PreflightInvalidDestination PreflightFailureKind = "invalid_destination"
|
||||
PreflightMissingCredential PreflightFailureKind = "missing_credential"
|
||||
PreflightInvalidCredential PreflightFailureKind = "invalid_credential"
|
||||
PreflightInsufficientPermissions PreflightFailureKind = "insufficient_permissions"
|
||||
|
||||
@@ -50,7 +50,7 @@ func (b *Backend) Preflight(ctx context.Context) error {
|
||||
}
|
||||
base, apiRoot, err := b.destinationAPI("preflight repository access")
|
||||
if err != nil {
|
||||
return err
|
||||
return &forge.PreflightFailure{Kind: forge.PreflightInvalidDestination, Err: err}
|
||||
}
|
||||
client := b.client.httpClient()
|
||||
var resolved repositoryResponse
|
||||
|
||||
Reference in New Issue
Block a user