1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 10:45: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

@@ -15,15 +15,15 @@ class PluginHandler extends Handler_Protected {
$plugin->$method();
} else {
user_error("Rejected ${plugin_name}->${method}(): invalid CSRF token.", E_USER_WARNING);
print error_json(6);
print Errors::to_json(Errors::E_UNAUTHORIZED);
}
} else {
user_error("Rejected ${plugin_name}->${method}(): unknown method.", E_USER_WARNING);
print error_json(13);
print Errors::to_json(Errors::E_UNKNOWN_METHOD);
}
} else {
user_error("Rejected ${plugin_name}->${method}(): unknown plugin.", E_USER_WARNING);
print error_json(14);
print Errors::to_json(Errors::E_UNKNOWN_PLUGIN);
}
}
}