This repository has been archived by the owner on Nov 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d318eb
commit 636af9e
Showing
2 changed files
with
32 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Speicher210\KontaktIO\Exception; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Speicher210\KontaktIO\Model\ApiErrorResponse; | ||
|
||
/** | ||
* Exception thrown whe the API key is not valid or not having enough permissions. | ||
*/ | ||
class ApiKeyInvalidException extends ApiException | ||
{ | ||
/** | ||
* Constructor. | ||
* | ||
* @param ResponseInterface $response The API response. | ||
*/ | ||
public function __construct(ResponseInterface $response) | ||
{ | ||
$apiErrorResponse = new ApiErrorResponse(); | ||
$apiErrorResponse->setStatus($response->getStatusCode()); | ||
$apiErrorResponse->setMessage($response->getReasonPhrase()); | ||
|
||
parent::__construct($apiErrorResponse); | ||
} | ||
} |