handle_remote_command_error
Processes exceptions raised during remote command execution by re-raising Click exceptions or wrapping other errors into a CeleryCommandException with specific exit codes and descriptive error messages.
def handle_remote_command_error(
command: string,
exc: Exception
) - > None
Translates low-level exceptions into user-friendly CeleryCommandException errors with specific exit codes and context-aware messages. This function ensures that connection failures or general execution errors are reported consistently to the CLI user.
Parameters
| Name | Type | Description |
|---|---|---|
| command | string | The name of the Celery command that was being executed when the error occurred. |
| exc | Exception | The exception instance caught during command execution, such as an OperationalError or ClickException. |
Returns
| Type | Description |
|---|---|
None | Nothing is returned; the function always re-raises the original exception or raises a new CeleryCommandException. |