Pascal Jahan Elahi (Pawsey)
01/21/2025, 1:23 AMMarvin
01/21/2025, 1:23 AMhandle_timeout
method within the task engine. This method is designed to handle TimeoutError
exceptions specifically. Here's a brief overview of what happens in the method:
- The exception is recorded using telemetry.
- If retries are not handled, the task's state is set to Failed
.
- A message is logged indicating that the task run exceeded the timeout.
- The state is updated to reflect the timeout failure.
You can see the relevant code in the task_engine.py file on GitHub.
For further handling, you might want to create a custom handler if you need to perform specific actions when a timeout occurs. The top-level API of Prefect includes functions like flow
and task
which you might use to define and manage flows and tasks.
For more information on handling task exceptions, you can refer to the Prefect documentation or explore the Prefect API.
If you have any specific requirements or need help implementing a custom solution, feel free to ask!Pascal Jahan Elahi (Pawsey)
01/21/2025, 1:26 AMMarvin
01/21/2025, 1:26 AMTaskRunFailed
exception in Prefect 2.x is not directly available in the documentation excerpts I retrieved. However, typically exceptions in Prefect can be found within the core modules related to task execution.
In Prefect 2.x, exceptions are often located in modules like prefect.exceptions
. You can try importing it like this:
python
from prefect.exceptions import TaskRunFailed
If this doesn't work, you might want to explore the specific module paths in your Prefect 2.x installation or consult the Prefect 2.x documentation for more details.
If you have further questions or need more specific guidance, feel free to ask!