ic
ic copied to clipboard
refactor(orchestrator): [CON-1631] re-organize error types in the orchestrator
As of today, UpgradeError and OrchestratorError are tightly coupled and some variants exist in both just to have a clean cast. Furthermore, a lot of OrchestratorErrors are errors linked to the registry.
This PR refactors error types in the following way:
- Upgrade-related errors are only in
UpgradeError, not inOrchestratorError. Theupgrademodule of the orchestrator now only returnsUpgradeErrorinstead ofOrchestratorError. Also, some specific upgrade errors were added as variants instead of relying on the generic catch-allOrchestratorError::UpgradeError. I think this change should also make it easier to add new upgrade error types when introducing new the new binaries-only "fast" upgrades. - Registry-related errors are in a new enum
RegistryErrorand some new variants were added to replace the unnatural occurrences ofUpgradeErrors in this module.UpgradeErrorandOrchestratorErrornow have a variantRegistryErrorand aFrom<RegistryError>implementation to easily cast them. - More consistent style and predictable behaviour in
registry_helper.rs, in particular where aOk(None)and anErrare not handled identically anymore. - Renamed some variants to omit the
Errorsuffix, following clippy suggestion.