From 4c8ec5909871a45d22e2ff3e95340332aa4aaa6a Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Tue, 17 Jul 2018 15:15:11 -0500 Subject: [PATCH] Custom error page (#8911) Generic error page, just a dump of the current page with additional information. DO NOT DELETE THIS TEXT #### Please note > Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting. - [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/) #### Testers If you would like to test this pull request then please run: `./scripts/github-apply `, i.e `./scripts/github-apply 5926` --- app/Exceptions/Handler.php | 6 ++- resources/views/errors/generic.blade.php | 67 ++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 resources/views/errors/generic.blade.php diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index de4a639145..eeb44f022f 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -66,7 +66,11 @@ class Handler extends ExceptionHandler return $exception->render($request); } - return parent::render($request, $exception); + if (config('app.debug')) { + return parent::render($request, $exception); + } + + return view('errors.generic')->with('exception', $exception); } /** diff --git a/resources/views/errors/generic.blade.php b/resources/views/errors/generic.blade.php new file mode 100644 index 0000000000..9a6585193d --- /dev/null +++ b/resources/views/errors/generic.blade.php @@ -0,0 +1,67 @@ + + + + + + + + +
+
+
+

Whoops, looks like something went wrong. Check your librenms.log.

+
+
+
+
+ +
+ +
+ +