Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config/twill.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,14 @@
*/
'debug' => env('APP_DEBUG', false),

/*
|--------------------------------------------------------------------------
| This parameter will throw errors if some error occurs instead of failing
| silently (eg. when rendering blocks)
|--------------------------------------------------------------------------
*/
'strict' => env('TWILL_STRICT', false),

/*
|--------------------------------------------------------------------------
| Base classes for automatic generation of Modules and Capsules
Expand Down
4 changes: 4 additions & 0 deletions src/Services/Blocks/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,11 +686,15 @@ public function renderView(
try {
return view($view, $data)->render();
} catch (Exception $e) {
if (config('twill.strict')) {
throw $e;
}
if (config('twill.debug')) {
$error = $e->getMessage() . ' in ' . $e->getFile();

return View::make('twill::errors.block', ['view' => $view, 'error' => $error])->render();
}
report($e);
}

return '';
Expand Down