mirror of
https://github.com/nextcloud/server.git
synced 2026-02-19 02:38:40 -05:00
fix: Avoid log spam on 404 routes not using GET
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
26696c4deb
commit
bbc6eee803
1 changed files with 4 additions and 1 deletions
|
|
@ -80,6 +80,7 @@ use OCP\Server;
|
|||
use OCP\Share;
|
||||
use OCP\User\Events\UserChangedEvent;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use function OCP\Log\logger;
|
||||
|
||||
require_once 'public/Constants.php';
|
||||
|
|
@ -1097,7 +1098,9 @@ class OC {
|
|||
try {
|
||||
Server::get(\OC\Route\Router::class)->match('/error/404');
|
||||
} catch (\Exception $e) {
|
||||
logger('core')->emergency($e->getMessage(), ['exception' => $e]);
|
||||
if (!$e instanceof MethodNotAllowedException) {
|
||||
logger('core')->emergency($e->getMessage(), ['exception' => $e]);
|
||||
}
|
||||
$l = Server::get(\OCP\L10N\IFactory::class)->get('lib');
|
||||
OC_Template::printErrorPage(
|
||||
$l->t('404'),
|
||||
|
|
|
|||
Loading…
Reference in a new issue