Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] __construct: added try catch block #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

drhossa
Copy link

@drhossa drhossa commented Jan 24, 2020

I'm using twigRenderer with patternLab Node 3.0.5. I've frequently issues with a dying watcher because of a fatal error coming from this part. I don't know if I'm doing it right, but a Try catch block fixed this.

PHP Fatal error:  Uncaught Twig_Error_Loader: The "source/_patterns/00-atoms/btn-3" directory does not exist ("/app/source/_patterns/00-atoms/btn-3"). in /app/node_modules/@basalt/twig-renderer/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:101
build_1  | Stack trace:
build_1  | #0 /app/node_modules/@basalt/twig-renderer/dist/TwigRenderer.php(37): Twig_Loader_Filesystem->addPath('source/_pattern...', 'atoms')
build_1  | #1 /app/node_modules/@basalt/twig-renderer/dist/server--async.php(46): BasaltInc\TwigRenderer\TwigRenderer->__construct(Array)
build_1  | #2 {main}
build_1  |   thrown in /app/node_modules/@basalt/twig-renderer/vendor/twig/twig/lib/Twig/Loader/Filesystem.php on line 101

try {
$this->loader->addPath($path, $namespace['id']);
} catch (Throwable $e) {
// ignore
Copy link
Contributor

@neclimdul neclimdul Apr 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty catch blocks always have me go 🤔

Could we report this back as some sort of notice or warning so a developer can clean up the problematic code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants