Skip to main content

ActionErrorCtx type

Methods available on ActionErrorCtx to help categorize the action failure. These categorizations should be finer grain, and most likely language specific.


def ActionErrorCtx.new_error_location(
file: str,
line: None | int = None
) -> ActionErrorLocation

Create a new error location, specifying a file path and an optional line number.

The file path should be either a project-relative path, or an absolute path.


def ActionErrorCtx.new_sub_error(
category: str,
message: None | str = None,
locations: None | list[ActionErrorLocation] | tuple[ActionErrorLocation, ...] = None
) -> ActionSubError

Create a new sub error, specifying an error category name, optional message, and an optional list of error locations.

The category should be finer grain error categorizations provided by the rule authors, and tend to be language specific. These should not be any kind of shared concepts among all errors for all languages/rules. For example, timeouts and infra errors should not go here - buck2 tries to categorize these types of errors automatically. An example of a finer grain error category may be the error code for rustc outputs.

The message will be emitted to the build report, and to the stderr in the error diagnostics section.


ActionErrorCtx.stderr: str

The stderr of the failed action.


ActionErrorCtx.stdout: str

The stdout of the failed action.