diff options
author | Andrew Dolgov <[email protected]> | 2021-02-23 22:26:07 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-23 22:26:07 +0300 |
commit | 8d2e3c2528e67f8650c122f014364a34bf690d2a (patch) | |
tree | fd44203c8a5919848f689cb6caa8c0c8d0784d54 /public.php | |
parent | 37d46411c77bda2b1823f7d230b06e36b7125a8d (diff) |
drop errors.php and simplify error handling
Diffstat (limited to 'public.php')
-rw-r--r-- | public.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/public.php b/public.php index 43aa66c1d..28f95d0a9 100644 --- a/public.php +++ b/public.php @@ -37,7 +37,7 @@ if (strpos($method, "_") === 0) { user_error("Refusing to invoke method $method which starts with underscore.", E_USER_WARNING); header("Content-Type: text/json"); - print error_json(6); + print Errors::to_json(Errors::E_UNAUTHORIZED); return; } @@ -50,7 +50,7 @@ } else { user_error("Refusing to invoke method $method which has required parameters.", E_USER_WARNING); header("Content-Type: text/json"); - print error_json(6); + print Errors::to_json(Errors::E_UNAUTHORIZED); } } else if (method_exists($handler, 'index')) { $handler->index(); @@ -60,5 +60,5 @@ } header("Content-Type: text/plain"); - print error_json(13); + print Errors::to_json(Errors::E_UNKNOWN_METHOD); ?> |