-
Notifications
You must be signed in to change notification settings - Fork 7
Framework Exceptions
PipelineExecutionException
This is the primary exception that can be raised during the execution of any pipeline by the framework. It serves as a wrapper exception. The framework will always throw a PipelineExecutionException
for any unhandled component exception that bubbles up with one exception. Any cancellation token related exceptions, OperationCanceledException
or TaskCanceledException
will not be wrapped in a PipelineExecutionException
. Instead they will be allowed to bubble up.
Here is an example of how you might want to handle exceptions from pipeline execution.
try
{
var result = await pipeline.ExecuteAsync(payload, cancellationToken);
}
catch (PipelineExecutionException executionException)
{
logger.Error(
executionException.InnerException,
"Pipeline execution halted! Component '{Name}' threw an unhandled exception.",
executionException.ThrowingComponent.Name);
}
This exception also captures the throwing component as you can see in the example above.
PipelineComponentSettingNotFoundException
This exception is thrown whenever an attempt is made to access the Settings
dictionary indexer by key when the key doesn't exist. For example:
public override void Initialize(string name, IDictionary<string, string> settings)
{
base.Initialize(name, settings);
_someSetting = Settings["SomeSettingName"];
}
This exception is very helpful tracking down missing component configurations when building large complex pipelines especially. It exposes properties for both the throwing component and the missing key.
PipelineComponentNotFoundException