for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace AcquiroPay\Exceptions;
use Exception;
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\ResponseInterface;
class BaseException extends Exception
{
public static function fromGuzzle(RequestException $exception)
return new static(
$exception->getMessage(),
$exception->getCode(),
$exception
);
}
public function getResponse(): ?ResponseInterface
$previous = $this->getPrevious();
if ($previous instanceof RequestException) {
return $previous->getResponse();
return null;