Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| PineconeApiException | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getStatusCode | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getResponseData | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Mbvb1223\Pinecone\Errors; |
| 6 | |
| 7 | class PineconeApiException extends PineconeException |
| 8 | { |
| 9 | /** @var array<string, mixed> */ |
| 10 | private readonly array $responseData; |
| 11 | |
| 12 | /** @param array<string, mixed> $responseData */ |
| 13 | public function __construct(string $message, int $statusCode, array $responseData = [], ?\Throwable $previous = null) |
| 14 | { |
| 15 | $this->responseData = $responseData; |
| 16 | |
| 17 | parent::__construct($message, $statusCode, $previous); |
| 18 | } |
| 19 | |
| 20 | public function getStatusCode(): int |
| 21 | { |
| 22 | return $this->getCode(); |
| 23 | } |
| 24 | |
| 25 | /** @return array<string, mixed> */ |
| 26 | public function getResponseData(): array |
| 27 | { |
| 28 | return $this->responseData; |
| 29 | } |
| 30 | } |