-
-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require psr/http-client, implement exceptions
- Loading branch information
Showing
7 changed files
with
138 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Omnipay\Common\Http; | ||
|
||
use Psr\Http\Message\RequestInterface; | ||
use Throwable; | ||
|
||
abstract class Exception extends \RuntimeException | ||
{ | ||
/** @var RequestInterface */ | ||
protected $request; | ||
|
||
public function __construct(string $message, RequestInterface $request, Throwable $previous = null) | ||
{ | ||
$this->request = $request; | ||
|
||
parent::__construct($message, 0, $previous); | ||
} | ||
|
||
/** | ||
* Returns the request. | ||
* | ||
* The request object MAY be a different object from the one passed to ClientInterface::sendRequest() | ||
* | ||
* @return RequestInterface | ||
*/ | ||
public function getRequest(): RequestInterface | ||
{ | ||
return $this->getRequest(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Omnipay\Common\Http\Exception; | ||
|
||
use Omnipay\Common\Http\Exception; | ||
use Psr\Http\Client\Exception\NetworkException as PsrNetworkException; | ||
|
||
class NetworkException extends Exception implements PsrNetworkException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Omnipay\Common\Http\Exception; | ||
|
||
use Omnipay\Common\Http\Exception; | ||
use Psr\Http\Client\Exception\RequestException as PsrRequestException; | ||
|
||
class RequestException extends Exception implements PsrRequestException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters