Koen
02/11/2025, 9:19 AMMarvin
02/11/2025, 9:19 AMPrefectException
class or any of its subclasses. Here's a basic example of how you might raise an exception with a message:
python
from prefect.exceptions import PrefectException
def my_function():
raise PrefectException("This is a custom exception message")
my_function()
Relevant links:
- Prefect exceptions source code
This code snippet raises a PrefectException
with a custom message. You can replace PrefectException
with any specific subclass like SerializationError
, ConfigurationError
, etc., depending on the context of your error.