Debian Codegraph @

lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/Exception/ParserException.php

raw symbols SCIP
1 <?php
2 namespace Aws\Api\Parser\Exception;
3
4 use Aws\HasMonitoringEventsTrait;
5 use Aws\MonitoringEventsInterface;
6 use Aws\ResponseContainerInterface;
7 use Psr\Http\Message\ResponseInterface;
8
9 class ParserException extends \RuntimeException implements
10 MonitoringEventsInterface,
11 ResponseContainerInterface
12 {
13 use HasMonitoringEventsTrait;
14
15 private $errorCode;
16 private $requestId;
17 private $response;
18
19 public function __construct($message = '', $code = 0, $previous = null, array $context = [])
20 {
21 $this->errorCode = isset($context['error_code']) ? $context['error_code'] : null;
22 $this->requestId = isset($context['request_id']) ? $context['request_id'] : null;
23 $this->response = isset($context['response']) ? $context['response'] : null;
24 parent::__construct($message, $code, $previous);
25 }
26
27 /**
28 * Get the error code, if any.
29 *
30 * @return string|null
31 */
32 public function getErrorCode()
33 {
34 return $this->errorCode;
35 }
36
37 /**
38 * Get the request ID, if any.
39 *
40 * @return string|null
41 */
42 public function getRequestId()
43 {
44 return $this->requestId;
45 }
46
47 /**
48 * Get the received HTTP response if any.
49 *
50 * @return ResponseInterface|null
51 */
52 public function getResponse()
53 {
54 return $this->response;
55 }
56 }