From 8d2e3c2528e67f8650c122f014364a34bf690d2a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 23 Feb 2021 22:26:07 +0300 Subject: drop errors.php and simplify error handling --- public.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'public.php') 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); ?> -- cgit v1.2.3