The doc comment array<int, class-string<Exception>> at position 4 could not be parsed: Unknown type name 'class-string' at position 4 in array<int, class-string<Exception>>.
Loading history...
25
*/
26
public function __construct(
27
private int $max_retry,
28
private array $exception_names,
29
private LoopMiddlewareInterface $chain,
30
) {
31
}
32
33
public function invoke(): bool
34
{
35
while ($this->current_retry_count <= $this->max_retry or $this->max_retry === -1) {
36
try {
37
$result = $this->chain->invoke();
38
$this->current_retry_count = 0;
39
return $result;
40
} catch (\Throwable $e) {
41
foreach ($this->exception_names as $exception_name) {