src/BatchResult.php
public function addException(RequestInterface $request, ClientExceptionInterface $exception): self
    {
        $new = clone $this;
        $new->exceptions->attach($request, $exception);

        return $new;
    }
public function addException(RequestInterface $request, ClientExceptionInterface $exception): self
    {
        $new = clone $this;
        $new->exceptions->attach($request, $exception);

        return $new;
    }
public function addException ( RequestInterface $ request , ClientExceptionInterface $ exception ) : self { $ new = clone $ this ; $ new -> exceptions -> attach ( $ request , $ exception ) ; return $ new ; }
Adds an exception in an immutable way.

@return BatchResult the new BatchResult with this request-exception pair added to it
Adds an exception in an immutable way .