summaryrefslogtreecommitdiffstats
path: root/application/exceptions/ApiException.php
blob: b3b9decffc3b8a4ab8a49c7455f7268b792818ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/*
 * Licensed under AGPLv3
 * (see COPYING for full license text)
 *
 */
namespace exceptions;

class ApiException extends \Exception {
	private $error_id;
	private $data;

	public function __construct($error_id, $message, $data = null)
	{
		parent::__construct($message);

		$this->error_id = $error_id;
		$this->data = $data;
	}

	public function get_error_id()
	{
		return $this->error_id;
	}

	public function get_data()
	{
		return $this->data;
	}

	public function get_http_error_code()
	{
		return 500;
	}
}