Table of Contents

Class StepFailedException

Namespace
Invex.Atom.Build.Exceptions
Assembly
Invex.Atom.Build.dll

Represents an exception thrown when a step within an Atom build target fails. This exception provides additional reporting capabilities through custom report data.

public sealed class StepFailedException : AtomException
Inheritance
object
Exception
StepFailedException

Examples

throw new StepFailedException("Could not validate a value");
try
{
    ...
}
catch (Exception ex)
{
    // It's not recommended to throw a new exception in a catch block without
    // including the original exception.
    throw new StepFailedException("An error occurred during the step execution", ex)
    {
        ReportData = new TextReportData(...);
    };
}

Remarks

This exception is used throughout the Atom framework to signal failures in build targets, such as task execution errors, failed external process calls (via Invex.Process.IProcessRunner), or unmet validation criteria within a target's logic. Consumers of the Atom framework can also throw StepFailedException to programmatically halt a build target and optionally provide custom report data using the ReportData property. The ReportData property allows attaching custom reporting information that can be used for enhanced error reporting, logging, or debugging purposes by Atom's reporting services.

This exception inherits from AtomException. Use BuildConfigurationException for configuration errors (duplicate targets, circular dependencies); use StepFailedException for runtime target execution failures.

Constructors

StepFailedException()

Initializes a new instance of the StepFailedException class with an empty message.

public StepFailedException()

Remarks

Using this constructor is generally not recommended. It is preferable to provide a descriptive message and/or an inner exception to aid in diagnosing the failure.

StepFailedException(string?)

Initializes a new instance of the StepFailedException class with a specified error message.

public StepFailedException(string? message)

Parameters

message string

The message that describes the error. If null, an empty string will be used.

StepFailedException(string, Exception?)

Represents an exception thrown when a step within an Atom build target fails. This exception provides additional reporting capabilities through custom report data.

public StepFailedException(string message, Exception? innerException = null)

Parameters

message string
innerException Exception

Examples

throw new StepFailedException("Could not validate a value");
try
{
    ...
}
catch (Exception ex)
{
    // It's not recommended to throw a new exception in a catch block without
    // including the original exception.
    throw new StepFailedException("An error occurred during the step execution", ex)
    {
        ReportData = new TextReportData(...);
    };
}

Remarks

This exception is used throughout the Atom framework to signal failures in build targets, such as task execution errors, failed external process calls (via Invex.Process.IProcessRunner), or unmet validation criteria within a target's logic. Consumers of the Atom framework can also throw StepFailedException to programmatically halt a build target and optionally provide custom report data using the ReportData property. The ReportData property allows attaching custom reporting information that can be used for enhanced error reporting, logging, or debugging purposes by Atom's reporting services.

This exception inherits from AtomException. Use BuildConfigurationException for configuration errors (duplicate targets, circular dependencies); use StepFailedException for runtime target execution failures.

See Also

Properties

ReportData

Gets custom report data associated with this step failure. This property can be used to attach additional context, diagnostic information, or custom reporting data that helps with error analysis and reporting within the Atom framework.

public ICustomReportData? ReportData { get; init; }

Property Value

ICustomReportData

An ICustomReportData instance containing custom report information, or null if no custom report data is associated with this exception.

Remarks

This property can only be set during object initialization (init-only property). It's designed to provide extensible reporting capabilities for different types of step failures that can be processed by Atom's outcome reporters.

See Also

See Also