Updated exceptions package
This commit is contained in:
@@ -39,12 +39,13 @@ class RedirectDisplayer implements DisplayerInterface
|
||||
* Get the error response associated with the given exception.
|
||||
*
|
||||
* @param \Exception $exception
|
||||
* @param string $id
|
||||
* @param int $code
|
||||
* @param string[] $headers
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function display(Exception $exception, $code, array $headers)
|
||||
public function display(Exception $exception, $id, $code, array $headers)
|
||||
{
|
||||
return redirect()->guest('auth/login');
|
||||
}
|
||||
@@ -62,13 +63,14 @@ class RedirectDisplayer implements DisplayerInterface
|
||||
/**
|
||||
* Can we display the exception?
|
||||
*
|
||||
* @param \Exception $exception
|
||||
* @param \Exception $original
|
||||
* @param \Exception $transformed
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function canDisplay(Exception $exception)
|
||||
public function canDisplay(Exception $original, Exception $transformed)
|
||||
{
|
||||
$redirect = $exception instanceof HttpExceptionInterface && $exception->getStatusCode() === 401;
|
||||
$redirect = $transformed instanceof HttpExceptionInterface && $transformed->getStatusCode() === 401;
|
||||
|
||||
return $redirect && !$this->request->is('api*');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user