-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExceptions.php
43 lines (29 loc) · 910 Bytes
/
Exceptions.php
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
36
37
38
39
40
41
42
43
<?php
require_once(__DIR__ . "/config.php");
class ValidationException extends Exception {
public function __construct(string $description) {
$obj = [
"status" => ERR_VAL,
"description" => $description,
];
parent::__construct(json_encode($obj, JSON_UNESCAPED_UNICODE));
}
}
class ServiceException extends Exception {
public function __construct($description) {
$obj = [
"status" => ERR_API,
"description" => $description,
];
parent::__construct(json_encode($obj, JSON_UNESCAPED_UNICODE));
}
}
class InternalException extends Exception {
public function __construct($description) {
$obj = [
"status" => ERR_INT,
"description" => $description,
];
parent::__construct(json_encode($obj, JSON_UNESCAPED_UNICODE));
}
}