mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix custom error messages (#13898)
* Fix custom error messages Laravel apparently wraps things in ViewException now and so does ignition. Ideally, we would plug in the same way as ignition, but just fix the old code for now. * Don't break the ViewException handling if we can't upgrade
This commit is contained in:
@@ -49,8 +49,12 @@ class Handler extends ExceptionHandler
|
||||
|
||||
// try to upgrade generic exceptions to more specific ones
|
||||
if (! config('app.debug')) {
|
||||
if ($exception instanceof \Illuminate\View\ViewException || $exception instanceof \Facade\Ignition\Exceptions\ViewException) {
|
||||
$base = $exception->getPrevious(); // get real exception
|
||||
}
|
||||
|
||||
foreach ($this->upgradable as $class) {
|
||||
if ($new = $class::upgrade($exception)) {
|
||||
if ($new = $class::upgrade($base ?? $exception)) {
|
||||
return parent::render($request, $new);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user