-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathexceptions.php
More file actions
30 lines (26 loc) · 1.09 KB
/
exceptions.php
File metadata and controls
30 lines (26 loc) · 1.09 KB
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
<?php
namespace MultiSite_JSON_API;
class GenericException extends \Exception {
public $url;
public $id;
public function __construct($message = '', $id = '', $url = 'https://github.com/remkade/multisite-json-api', $code = 400, Exception $previous = null) {
parent::__construct($message, $code);
$this->url = $url;
$this->id = $id;
}
}
class SiteNotFoundException extends GenericException {
public function __construct($message = 'Unable to Find Site', $id = 'site_not_found', $url = 'https://github.com/remkade/multisite-json-api') {
parent::__construct($message, $id, $url, 404);
}
}
class SiteCreationException extends GenericException {
public function __construct($message = 'Error Creating Site', $id = 'site_creation_error', $url = 'https://github.com/remkade/multisite-json-api') {
parent::__construct($message, $id, $url, 400);
}
}
class UserCreationException extends GenericException {
public function __construct($message = 'Error Creating User', $id = 'user_creation_error', $url = 'https://github.com/remkade/multisite-json-api') {
parent::__construct($message, $id, $url, 400);
}
}