From 33efe571e3e7ebd607e92345c2e94e7fd8ae27f0 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 2 Feb 2015 19:45:11 +0100 Subject: Rework api error handling Signed-off-by: Florian Pritz --- application/exceptions/ApiException.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 application/exceptions/ApiException.php (limited to 'application/exceptions/ApiException.php') diff --git a/application/exceptions/ApiException.php b/application/exceptions/ApiException.php new file mode 100644 index 000000000..b288bbaa2 --- /dev/null +++ b/application/exceptions/ApiException.php @@ -0,0 +1,30 @@ +error_id = $error_id; + $this->data = $data; + } + + public function get_error_id() + { + return $this->error_id; + } + + public function get_data() + { + return $this->data; + } +} -- cgit v1.2.3-24-g4f1b From bcd7920b817b60df9b1b266118419e44c39900db Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 3 Feb 2015 13:59:59 +0100 Subject: generalize authentication handling Signed-off-by: Florian Pritz --- application/exceptions/ApiException.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'application/exceptions/ApiException.php') diff --git a/application/exceptions/ApiException.php b/application/exceptions/ApiException.php index b288bbaa2..b3b9decff 100644 --- a/application/exceptions/ApiException.php +++ b/application/exceptions/ApiException.php @@ -27,4 +27,9 @@ class ApiException extends \Exception { { return $this->data; } + + public function get_http_error_code() + { + return 500; + } } -- cgit v1.2.3-24-g4f1b