Skip to content

Commit

Permalink
Add network exception
Browse files Browse the repository at this point in the history
  • Loading branch information
jenky committed Jul 13, 2023
1 parent c8aa542 commit 314d82d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Exception/NetworkException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

namespace Jenky\Atlas\Exception;

use Psr\Http\Client\NetworkExceptionInterface;
use Psr\Http\Message\RequestInterface;

class NetworkException extends \RuntimeException implements NetworkExceptionInterface
{
/**
* @var RequestInterface
*/
private $request;

public function __construct(
string $message,
RequestInterface $request,
?\Throwable $previous = null
) {
parent::__construct($message, 0, $previous);
$this->request = $request;
}

public function getRequest(): RequestInterface
{
return $this->request;
}
}

0 comments on commit 314d82d

Please sign in to comment.