mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 03:15:56 +00:00
drop errors.php and simplify error handling
This commit is contained in:
@@ -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);
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user