1
0
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:
Andrew Dolgov
2021-02-23 22:26:07 +03:00
parent 37d46411c7
commit 8d2e3c2528
19 changed files with 94 additions and 200 deletions

View File

@@ -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);
?>