diff --git a/apps/dav/lib/Connector/Sabre/Server.php b/apps/dav/lib/Connector/Sabre/Server.php index a7314d812dceb..f3bfac1d6e090 100644 --- a/apps/dav/lib/Connector/Sabre/Server.php +++ b/apps/dav/lib/Connector/Sabre/Server.php @@ -9,6 +9,7 @@ use Sabre\DAV\Exception; use Sabre\DAV\Version; +use TypeError; /** * Class \OCA\DAV\Connector\Sabre\Server @@ -47,20 +48,17 @@ public function start() { $this->httpRequest->setBaseUrl($this->getBaseUri()); $this->invokeMethod($this->httpRequest, $this->httpResponse); } catch (\Throwable $e) { - if ($e instanceof \TypeError) { + try { + $this->emit('exception', [$e]); + } catch (\Exception) { + } + + if ($e instanceof TypeError) { /* * The TypeError includes the file path where the error occurred, * potentially revealing the installation directory. - * - * By re-throwing the exception, we ensure that the - * default exception handler processes it. */ - throw $e; - } - - try { - $this->emit('exception', [$e]); - } catch (\Exception $ignore) { + $e = new TypeError('A type error occurred. For more details, please refer to the logs, which provide additional context about the type error.'); } $DOM = new \DOMDocument('1.0', 'utf-8');