#[non_exhaustive]pub enum ForgeError {
Show 18 variants
InvalidResource(ResourceError),
WrongResource {
resource: String,
expected: String,
},
NotBound {
namespace: String,
},
Unsupported {
operation: String,
hint: String,
},
NotFound {
what: String,
},
AlreadyExists {
resource: String,
forge_id: Option<u64>,
},
Moved {
what: String,
location: String,
},
Unauthorized(String),
Forbidden(String),
Rejected {
status: u16,
message: String,
},
RateLimited {
retry_after_secs: Option<u64>,
},
Unavailable(String),
BindRejected(String),
LinkFailed(String),
Webhook(String),
Config(String),
Protocol(String),
CapabilityChanged {
namespace: String,
capability: String,
available: bool,
reason: String,
},
}Expand description
A failed forge operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidResource(ResourceError)
The input is not a valid forge-qualified resource.
WrongResource
The resource is valid but not on this adapter’s forge, or not the shape the operation needs (a namespace where a repo was expected).
NotBound
No namespace binding covers this resource, so the adapter holds no credential for it.
Unsupported
The forge (or this namespace on it) cannot do this — see
crate::Capabilities. hint says what a human can do instead.
NotFound
The resource does not exist, or the credential cannot see it (forges deliberately do not distinguish the two).
AlreadyExists
Refused to create something that already exists. Carries the forge id so the core can tell its own earlier attempt from a squatter.
Fields
Moved
The forge answered with a redirect the adapter will not follow — a renamed or transferred repository, usually.
The forge rejected the adapter’s credentials (expired, revoked, wrong key). Re-binding or rotating the key is the fix, not a retry.
Forbidden(String)
Authenticated, but not permitted — usually a permission the owner has not approved on the installation.
Rejected
The forge refused the request as invalid or conflicting (a rule violation, a validation failure).
RateLimited
Rate-limited. Retry after the given number of seconds, if the forge said.
The forge could not be reached or failed (network, 5xx, timeout).
BindRejected(String)
A namespace bind callback did not match the bind that was started —
wrong or stale state, or an installation on the wrong owner.
LinkFailed(String)
Linking a member’s forge account did not complete (expired, denied).
Webhook(String)
A webhook failed verification or could not be parsed. Always treat as hostile input: do not act on it.
Config(String)
The adapter or the bootstrap config is incomplete or invalid.
Protocol(String)
The forge answered with something the adapter does not understand.
CapabilityChanged
A capability of the namespace turned out different from what was planned with (a forge plan without a feature). The adapter has updated its own copy; the caller persists the change and plans again.
Implementations§
Source§impl ForgeError
impl ForgeError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether retrying the same operation later can succeed without anyone changing anything. Rejections, auth failures and bad input are not.
Trait Implementations§
Source§impl Clone for ForgeError
impl Clone for ForgeError
Source§impl Debug for ForgeError
impl Debug for ForgeError
Source§impl Display for ForgeError
impl Display for ForgeError
impl Eq for ForgeError
Source§impl Error for ForgeError
impl Error for ForgeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()