fix i18n when http exception occurs
This commit is contained in:
parent
1618707e5d
commit
fd7afd2ead
|
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Exceptions;
|
namespace App\Exceptions;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use App\Http\Middleware\Internationalization;
|
||||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||||
use Illuminate\Foundation\Validation\ValidationException;
|
use Illuminate\Foundation\Validation\ValidationException;
|
||||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
|
|
@ -55,6 +56,11 @@ class Handler extends ExceptionHandler
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($e instanceof HttpException) {
|
||||||
|
// call i18n middleware manually since http exceptions won't be sent through it
|
||||||
|
(new Internationalization)->handle($request, function(){});
|
||||||
|
}
|
||||||
|
|
||||||
if ($e instanceof ValidationException) {
|
if ($e instanceof ValidationException) {
|
||||||
return $e->getResponse()->setStatusCode(200);
|
return $e->getResponse()->setStatusCode(200);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user