https://dagster.io/ logo
#ask-ai
Title
# ask-ai
d

David Takacs

03/07/2024, 1:47 PM
Do exceptions thrown within an op halt execution?
s

Scout

03/07/2024, 1:47 PM
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.