The type RepositoryError = GitUrlError | RepositoryMetadataError is a union of enums and these errors are frequently "converted" to error messages by just doing str(repositoryError) which creates a non-readable error message, e.g. metadata_unknown.
These enums should always be converted to a human-readable message when we are returning/raising an error response, e.g.
if repositoryError in [RepositoryMetadataError.metadata_unknown, RepositoryMetadataError.metadata_unauthorized]:
raise errors.ForbiddenError(message=f"You do not have access to repository {repo}.")
The
type RepositoryError = GitUrlError | RepositoryMetadataErroris a union of enums and these errors are frequently "converted" to error messages by just doingstr(repositoryError)which creates a non-readable error message, e.g.metadata_unknown.These enums should always be converted to a human-readable message when we are returning/raising an error response, e.g.