Classify invalid delivery destinations during preflight
This commit is contained in:
@@ -48,11 +48,13 @@ type DeliveryDestination struct {
|
||||
Token string
|
||||
}
|
||||
|
||||
// DeliveryPreflightFailureKind classifies a failure while checking a delivery
|
||||
// destination's credentials and repository access.
|
||||
// DeliveryPreflightFailureKind classifies a failure while checking destination
|
||||
// settings, credentials, and repository access.
|
||||
type DeliveryPreflightFailureKind string
|
||||
|
||||
const (
|
||||
// DeliveryPreflightInvalidDestination means the destination settings fail local validation.
|
||||
DeliveryPreflightInvalidDestination DeliveryPreflightFailureKind = "invalid_destination"
|
||||
// DeliveryPreflightMissingCredential means no nonblank credential was supplied.
|
||||
DeliveryPreflightMissingCredential DeliveryPreflightFailureKind = "missing_credential"
|
||||
// DeliveryPreflightInvalidCredential means the selected service rejected the credential.
|
||||
@@ -221,6 +223,8 @@ func publicPreflightError(err error) error {
|
||||
}
|
||||
kind := DeliveryPreflightUnavailable
|
||||
switch failure.Kind {
|
||||
case forge.PreflightInvalidDestination:
|
||||
kind = DeliveryPreflightInvalidDestination
|
||||
case forge.PreflightMissingCredential:
|
||||
kind = DeliveryPreflightMissingCredential
|
||||
case forge.PreflightInvalidCredential:
|
||||
|
||||
Reference in New Issue
Block a user