From 4d64c6bce585de11f6eaf374148dd51cca9b7c6e Mon Sep 17 00:00:00 2001 From: Yoann Celton Date: Tue, 27 Nov 2018 22:40:33 +1100 Subject: [PATCH] Adding exceptions --- src/Exceptions/MatrixException.php | 10 ++++++ src/Exceptions/MatrixHttpLibException.php | 17 +++++++++++ src/Exceptions/MatrixRequestException.php | 34 +++++++++++++++++++++ src/Exceptions/MatrixUnexpectedResponse.php | 25 +++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 src/Exceptions/MatrixException.php create mode 100644 src/Exceptions/MatrixHttpLibException.php create mode 100644 src/Exceptions/MatrixRequestException.php create mode 100644 src/Exceptions/MatrixUnexpectedResponse.php diff --git a/src/Exceptions/MatrixException.php b/src/Exceptions/MatrixException.php new file mode 100644 index 0000000..b449ccd --- /dev/null +++ b/src/Exceptions/MatrixException.php @@ -0,0 +1,10 @@ +httpCode = $code; + $this->content = $content; + } + + /** + * @return int + */ + public function getHttpCode(): int { + return $this->httpCode; + } + + /** + * @return string + */ + public function getContent(): string { + return $this->content; + } +} \ No newline at end of file diff --git a/src/Exceptions/MatrixUnexpectedResponse.php b/src/Exceptions/MatrixUnexpectedResponse.php new file mode 100644 index 0000000..4d80592 --- /dev/null +++ b/src/Exceptions/MatrixUnexpectedResponse.php @@ -0,0 +1,25 @@ +content = $content; + } + + /** + * @return string + */ + public function getContent(): string { + return $this->content; + } +} \ No newline at end of file