feat(registry): add workspace-scoped artifact metadata
This commit is contained in:
@@ -588,6 +588,36 @@ impl From<RegistryError> for ApiError {
|
||||
format!("import job {job_id} was already applied with different parameters"),
|
||||
json!({ "job_id": job_id }),
|
||||
),
|
||||
RegistryError::SourceNotFound { source_id } => Self::not_found_with_context(
|
||||
"artifact source was not found",
|
||||
json!({
|
||||
"source_id": source_id,
|
||||
"error_code": "artifact_source_not_found"
|
||||
}),
|
||||
),
|
||||
RegistryError::SourceConflict { source_id } => Self::conflict_with_context(
|
||||
"artifact source metadata or lifecycle conflicts with the request",
|
||||
json!({
|
||||
"source_id": source_id,
|
||||
"error_code": "artifact_source_conflict",
|
||||
"recovery": "reload"
|
||||
}),
|
||||
),
|
||||
RegistryError::SourceUnavailable => Self::unprocessable_with_context(
|
||||
"artifact source is unavailable",
|
||||
json!({ "error_code": "artifact_source_unavailable" }),
|
||||
),
|
||||
RegistryError::SourceIntegrity => Self::unprocessable_with_context(
|
||||
"artifact source failed integrity verification",
|
||||
json!({ "error_code": "artifact_source_integrity" }),
|
||||
),
|
||||
RegistryError::InvalidArtifactSource { field } => Self::validation_with_context(
|
||||
"artifact source metadata is invalid",
|
||||
json!({
|
||||
"field": field,
|
||||
"error_code": "artifact_source_invalid"
|
||||
}),
|
||||
),
|
||||
RegistryError::Storage(_) => Self::internal("registry operation failed"),
|
||||
RegistryError::Migration(_)
|
||||
| RegistryError::Serialization(_)
|
||||
|
||||
Reference in New Issue
Block a user