src/Exception/ClientException.php
public function jsonSerialize() {
        $result = [
            'message' => $this->getMessage(),
            'status' => $this->getCode()
        ];
        if ($this->getDescription()) {
            $result['description'] = $this->getDescription();
        }
        return $result;
    }
public function jsonSerialize() {
        $result = [
            'message' => $this->getMessage(),
            'status' => $this->getCode()
        ];
        if ($this->getDescription()) {
            $result['description'] = $this->getDescription();
        }
        return $result;
    }
Specify data which should be serialized to JSON.

@link http://php.net/manual/en/jsonserializable.jsonserialize.php
@return mixed data which can be serialized by <b>json_encode</b>,
which is a value of any type other than a resource.