You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try {
returnview($view, $data)->render();
} catch (Exception$e) {
if (config('twill.strict')) {// can be named throw or somethingthrow$e;
}
if (config('twill.debug')) {
$error = $e->getMessage() . ' in ' . $e->getFile();
returnView::make('twill::errors.block', ['view' => $view, 'error' => $error])->render();
}
report($e);// add this
}
return'';
Solution B, my favorite:
This entire logic does not seem to be useful and can be added specifically by any application if needed. So I would suggest to just drop try catch block entirely. Just look how beautiful it is:
returnview($view, $data)->render();
The text was updated successfully, but these errors were encountered:
Description
Errors are not reported and displayed on production
Steps to reproduce
Create a twill block which uses some undefined variable. This block will fail and error won't be displayed and reported in production.
https://github.com/area17/twill/blob/3.x/src/Services/Blocks/Block.php#L688
Expected result
I would expect to have this error logged and reported to my error tracker and this page should not load for my users so that I could fix it asap.
Actual result
App just crashes silently
Versions
Twill version: 3.2
Laravel version: 11.0
PHP version: 8.3
Solution A
https://github.com/area17/twill/blob/3.x/src/Services/Blocks/Block.php#L688
Change to:
Solution B, my favorite:
This entire logic does not seem to be useful and can be added specifically by any application if needed. So I would suggest to just drop try catch block entirely. Just look how beautiful it is:
The text was updated successfully, but these errors were encountered: