add Errors.php

This commit is contained in:
Andrew Dolgov 2021-02-23 22:31:43 +03:00
parent 8d2e3c2528
commit a42e8aad97
1 changed files with 12 additions and 0 deletions

12
classes/errors.php Normal file
View File

@ -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]]);
}
}