if (!
$response->
isException()) { return;
} $this->isInsideErrorHandlerLoop = true;
// Get exception information
$error =
new ArrayObject([], ArrayObject::ARRAY_AS_PROPS
);
$exceptions =
$response->
getException();
$exception =
$exceptions[0
];
$error->
offsetSet('exception',
$exception);
// Keep a copy of the original request
$error->
offsetSet('request',
clone $request);
// Get a count of the number of exceptions encountered
$this->exceptionCountAtFirstEncounter = \
count($exceptions);
// Forward to the error handler
$request->
setParam('error_handler',
$error) ->
setControllerName('error'
) ->
setActionName('error'
)