get_log_policy
Determines the appropriate logging policy for a task failure based on the exception type and error information.
def get_log_policy(
task: Task,
einfo: ExceptionInfo,
exc: Exception
) - > LogPolicy
Determines the appropriate logging strategy for a task failure based on the exception type and error information. This function selects a policy that dictates how the error should be recorded, distinguishing between expected task behavior, internal system errors, and ignored or rejected tasks.
Parameters
| Name | Type | Description |
|---|---|---|
| task | Task | The task instance that encountered the error, used to check for expected exception types defined in the 'throws' attribute. |
| einfo | ExceptionInfo | The wrapper containing traceback and metadata about the exception, specifically used to identify if the error was internal to the worker. |
| exc | Exception | The actual exception instance raised during task execution. |
Returns
| Type | Description |
|---|---|
LogPolicy | The logging policy object that defines the severity and format for recording the specific failure. |