-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPipelineExecutionException.php
More file actions
37 lines (34 loc) · 1.02 KB
/
PipelineExecutionException.php
File metadata and controls
37 lines (34 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
declare(strict_types=1);
namespace KaririCode\ProcessorPipeline\Exception;
/**
* Thrown when pipeline execution fails at a specific stage.
*
* Captures the processor name, stage index, and original exception
* for structured observability (ARFA 1.3 P5).
*
* @package KaririCode\ProcessorPipeline\Exception
* @author Walmir Silva <walmir.silva@kariricode.org>
* @copyright 2025 KaririCode
* @license MIT
* @version 2.0.0
* @since 4.0.0
*/
final class PipelineExecutionException extends ProcessorPipelineException
{
public static function atStage(
string $processorName,
int $stageIndex,
\Throwable $cause,
): self {
return new self(
message: "Pipeline failed at stage {$stageIndex} (processor: {$processorName}): {$cause->getMessage()}",
previous: $cause,
context: [
'processor' => $processorName,
'stage' => $stageIndex,
'causeClass' => $cause::class,
],
);
}
}