3 namespace BookStack\Exceptions;
5 use Illuminate\Contracts\Foundation\ExceptionRenderer;
7 class BookStackExceptionHandlerPage implements ExceptionRenderer
9 public function render($throwable)
11 return view('errors.debug', [
12 'error' => $throwable->getMessage(),
13 'errorClass' => get_class($throwable),
14 'trace' => $throwable->getTraceAsString(),
15 'environment' => $this->getEnvironment(),
19 protected function safeReturn(callable $callback, $default = null)
23 } catch (\Exception $e) {
28 protected function getEnvironment(): array
31 'PHP Version' => phpversion(),
32 'BookStack Version' => $this->safeReturn(function () {
33 $versionFile = base_path('version');
35 return trim(file_get_contents($versionFile));
37 'Theme Configured' => $this->safeReturn(function () {
38 return config('view.theme');