protected function genericResponse(Exception $exception)
{
$replacements = $this->prepareReplacements($exception);
$response = $this->newResponseArray();
array_walk_recursive($response, function (&$value, $key) use($exception, $replacements) {
if (starts_with($value, ':') && isset($replacements[$value])) {
$value = $replacements[$value];
}
});
$response = $this->recursivelyRemoveEmptyReplacements($response);
return new Response($response, $this->getStatusCode($exception), $this->getHeaders($exception));
}