We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf9edc1 commit 13b56e6Copy full SHA for 13b56e6
1 file changed
lib/Service/PicoService.php
@@ -43,6 +43,7 @@
43
use OCP\Files\NotFoundException;
44
use OCP\Files\NotPermittedException;
45
use OCP\ILogger;
46
+use Twig\Error\Error;
47
48
class PicoService
49
{
@@ -147,6 +148,16 @@ public function getPage(WebsiteRequest $websiteRequest): PicoPage
147
148
$this->loadPicoPlugins($pico);
149
150
$output = $pico->run();
151
+ } catch (Error $e) {
152
+ $this->logger->error(
153
+ 'Twig Error',
154
+ [ 'error' => $e->getMessage(),
155
+ 'file' => $e->getFile(),
156
+ 'line_number' => $e->getTemplateLine()
157
+ ]
158
+ );
159
+ $exception = new PicoRuntimeException($e);
160
+ throw $exception;
161
} catch (WebsiteInvalidFilesystemException $e) {
162
throw $e;
163
} catch (InvalidPathException | NotFoundException | NotPermittedException $e) {
0 commit comments