EasyPost\Error::__construct PHP Метод

__construct() публичный Метод

constructor
public __construct ( string $message = null, integer $httpStatus = null, string $httpBody = null )
$message string
$httpStatus integer
$httpBody string
    public function __construct($message = null, $httpStatus = null, $httpBody = null)
    {
        parent::__construct($message);
        $this->httpStatus = $httpStatus;
        $this->httpBody = $httpBody;
        try {
            $this->jsonBody = json_decode($httpBody, true);
            if (isset($this->jsonBody) && !empty($this->jsonBody['error']['param'])) {
                $this->param = $this->jsonBody['error']['param'];
            } else {
                $this->param = null;
            }
            if (isset($this->jsonBody) && !empty($this->jsonBody['error']['errors'])) {
                $this->errors = $this->jsonBody['error']['errors'];
            } else {
                $this->errors = null;
            }
            if (isset($this->jsonBody) && !empty($this->jsonBody['error']['code'])) {
                $this->ecode = $this->jsonBody['error']['code'];
            } else {
                $this->ecode = null;
            }
        } catch (\Exception $e) {
            $this->jsonBody = null;
        }
    }