private function checkStatusCode()
{
$code = $this->getInfo('http_code');
if (500 <= $code) {
throw new ServerException($this);
}
if (400 <= $code) {
throw new ClientException($this);
}
if ($this->initializer) {
self::initialize($this);
}
if ($throw) {
$this->checkStatusCode();
}
if (null === $this->content) {
$content = null;
{
$performing = $this->multi->performing;
$this->multi->performing = $performing || '_0' === curl_getinfo($this->handle, \CURLINFO_PRIVATE);
try {
return $this->doGetContent($throw);
} finally {
$this->multi->performing = $performing;
}
}
$response = $client->request(
'GET',
//$this->baseUrl . 'WebPage/Sections'
$this->intraServerUrl . 'rest/api/services/newspaper/' . $sectionId
);
$content = $response->getContent();
$content = json_decode($content, true);
if ($content == null || $content == "") {
return null;
}
return $content['result'];
* @throws ClientExceptionInterface
*/
public function getSectionById(HttpClientInterface $client, $type, $id): object
{
$news = array();
$section = $this->getOneSectionById($client, $id);
//foreach ($sections as $section) {
// if ($section['Type'] === $type && $section['id'] === $id && $section['Active']) {
$news = (object) array(
'id' => $section['id'],
'title' => $section['Title'],
public function detail(HttpClientInterface $client, $type, $id): Response
{
$methods = new Methods();
$unitsEmsad = $methods->getUnitsByEmsad($client);
$unitsCecyte = $methods->getUnitsByCecyte($client);
$sectionById = $methods->getSectionById($client, $type, $id);
return $this->render('sections/detail.html.twig', [
'isSuccess' => true,
'unitsCecyte' => $unitsCecyte,
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
No log messages
ServerException
|
---|
Symfony\Component\HttpClient\Exception\ServerException: HTTP/1.1 500 Internal Server Error returned for "https://intra.cecytechihuahua.edu.mx/rest/api/services/newspaper/01DB58C6-0FB9-4C47-8922-29C92BB21656". at vendor/symfony/http-client/Response/CommonResponseTrait.php:174 at Symfony\Component\HttpClient\Response\CurlResponse->checkStatusCode() (vendor/symfony/http-client/Response/CommonResponseTrait.php:48) at Symfony\Component\HttpClient\Response\CurlResponse->doGetContent() (vendor/symfony/http-client/Response/CurlResponse.php:232) at Symfony\Component\HttpClient\Response\CurlResponse->getContent() (src/Methods/Methods.php:101) at App\Methods\Methods->getOneSectionById() (src/Methods/Methods.php:280) at App\Methods\Methods->getSectionById() (src/Controller/SectionsController.php:42) at App\Controller\SectionsController->detail() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:35) at require_once('/var/www/vhosts/cecytechihuahua.edu.mx/httpdocs/vendor/autoload_runtime.php') (public/index.php:5) |