mirror of
https://github.com/nextcloud/server.git
synced 2026-06-14 03:02:01 -04:00
fix: avoid outer "uncaught exception" for ServerMaintenanceMode
We already exclude ServerMaintenanceMode in the inner logger, but there are some spots where it can can bubble up still via DAV. Fixes #55894 Signed-off-by: Josh <josh.t.richards@gmail.com>
This commit is contained in:
parent
ed1647b80d
commit
bf9949ecc0
1 changed files with 13 additions and 6 deletions
|
|
@ -58,6 +58,7 @@ use OCA\DAV\DAV\ViewOnlyPlugin;
|
|||
use OCA\DAV\Db\PropertyMapper;
|
||||
use OCA\DAV\Events\SabrePluginAddEvent;
|
||||
use OCA\DAV\Events\SabrePluginAuthInitEvent;
|
||||
use OCA\DAV\Exception\ServerMaintenanceMode;
|
||||
use OCA\DAV\Files\BrowserErrorPagePlugin;
|
||||
use OCA\DAV\Files\FileSearchBackend;
|
||||
use OCA\DAV\Files\LazySearchBackend;
|
||||
|
|
@ -422,12 +423,18 @@ class Server {
|
|||
/** @var IEventLogger $eventLogger */
|
||||
$eventLogger = \OCP\Server::get(IEventLogger::class);
|
||||
$eventLogger->start('dav_server_exec', '');
|
||||
$this->server->start();
|
||||
$eventLogger->end('dav_server_exec');
|
||||
if ($this->profiler->isEnabled()) {
|
||||
$eventLogger->end('runtime');
|
||||
$profile = $this->profiler->collect(\OCP\Server::get(IRequest::class), new Response());
|
||||
$this->profiler->saveProfile($profile);
|
||||
try {
|
||||
$this->server->start();
|
||||
} catch (ServerMaintenanceMode $e) {
|
||||
// Sabre already sent a 503; avoid the global "Uncaught exception" log.
|
||||
// do not rethrow
|
||||
} finally {
|
||||
$eventLogger->end('dav_server_exec');
|
||||
if ($this->profiler->isEnabled()) {
|
||||
$eventLogger->end('runtime');
|
||||
$profile = $this->profiler->collect(\OCP\Server::get(IRequest::class), new Response());
|
||||
$this->profiler->saveProfile($profile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue