summaryrefslogtreecommitdiff
path: root/classes/errors.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-23 22:31:43 +0300
committerAndrew Dolgov <[email protected]>2021-02-23 22:31:43 +0300
commita42e8aad97b66fd4964263e37a1b40164e495b4c (patch)
tree55f6e9e810e6b926e52ca9e2c1736c74f4e1b359 /classes/errors.php
parent8d2e3c2528e67f8650c122f014364a34bf690d2a (diff)
add Errors.php
Diffstat (limited to 'classes/errors.php')
-rw-r--r--classes/errors.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/classes/errors.php b/classes/errors.php
new file mode 100644
index 000000000..be175418e
--- /dev/null
+++ b/classes/errors.php
@@ -0,0 +1,12 @@
+<?php
+class Errors {
+ const E_SUCCESS = "E_SUCCESS";
+ const E_UNAUTHORIZED = "E_UNAUTHORIZED";
+ const E_UNKNOWN_METHOD = "E_UNKNOWN_METHOD";
+ const E_UNKNOWN_PLUGIN = "E_UNKNOWN_PLUGIN";
+ const E_SCHEMA_MISMATCH = "E_SCHEMA_MISMATCH";
+
+ static function to_json(string $code) {
+ return json_encode(["error" => ["code" => $code]]);
+ }
+}