$this->
add($exceptionHandler);
} } public function add(ExceptionHandlerInterface
$exceptionHandler): void
{ $this->exceptionHandlers
[$exceptionHandler->
getPriority()][] =
$exceptionHandler;
} public function matchException(\Exception
$e): ?\Exception
{ foreach ($this->
getExceptionHandlers() as $priorityExceptionHandlers) { foreach ($priorityExceptionHandlers as $exceptionHandler) { $innerException =
$exceptionHandler->
matchException($e);
if ($innerException instanceof \Exception
) { return $innerException;
} } } return null;
}