handle($request); $output = ob_get_clean(); } catch (Throwable $throwable) { ob_end_clean(); throw $throwable; } $body = $response->getBody(); if (is_string($output) && $output !== '' && $body->isWritable()) { $body->write($output); } return $response; } }