Do exceptions thrown within an op halt execution?
# ask-ai
d
Do exceptions thrown within an op halt execution?
s
Yes, exceptions thrown within an asset (previously known as an op) will halt the execution of that asset. According to the documentation, all errors thrown by the Dagster framework inherit from
DagsterError
. When user code executed within an asset throws an exception, Dagster uses an error boundary to catch these exceptions and re-raise them wrapped in a subclass of
DagsterUserCodeExecutionError
. This provides additional context for the original exceptions, injected by the Dagster runtime. If an exception is not caught within the user code, the execution of the asset will be interrupted, and the exception will be handled by Dagster's error boundary. This behavior ensures that errors in user code do not go unhandled and that they are clearly communicated back to the user with the appropriate context.