Symfony Exception

RequestException

HTTP 500 Internal Server Error

HTTP request returned status code 502.

Exception

Illuminate\Http\Client\ RequestException

  1.      * @throws \Illuminate\Http\Client\RequestException
  2.      */
  3.     public function throw()
  4.     {
  5.         if ($this->serverError() || $this->clientError()) {
  6.             throw new RequestException($this);
  7.         }
  8.         return $this;
  9.     }
  1.        if ($response->successful())
  2.            return $tokenRequest $response->json() : $response->json()['data'];
  3.        else {
  4.            \Log::error("Error al solicitar el recurso: $recurso");
  5.            \Log::error("{$response->getReasonPhrase()} | {$response->getStatusCode()}");
  6.           $response->throw();
  7.        }
  8.     }
ClientCustom->httpRequest('get', 'secciones', array('menu' => 1, 'company_id' => '12')) in /var/www/vhosts/dimater.weyop.com/fe/app/Http/Controllers/Controller.php (line 46)
  1.         //Secciones Header
  2.         $params = [
  3.             'menu' => 1,
  4.         ];
  5.         $secciones $this->api->client->httpRequest('get''secciones'$params);
  6.         view()->share('seccionesHeader'$secciones);
  7.         //Etiquetas Header
  8.         $params = [
  9.             'menu' => 1,
  1. class ProductosController extends Controller
  2. {
  3.     public function __construct()
  4.     {
  5.         $this->api = new Api();
  6.         $this->view_ready();
  7.         $this->pageTitle env('SITE_NAME');
  8.     }
  9.     public function catalogo(Request $request)
  10.     {
ProductosController->__construct()
  1.             throw $e;
  2.         }
  3.         array_pop($this->buildStack);
  4.         return $reflector->newInstanceArgs($instances);
  5.     }
  6.     /**
  7.      * Resolve all of the dependencies from the ReflectionParameters.
  8.      *
  1.         // We're ready to instantiate an instance of the concrete type registered for
  2.         // the binding. This will instantiate the types, as well as resolve any of
  3.         // its "nested" dependencies recursively until all have gotten resolved.
  4.         if ($this->isBuildable($concrete$abstract)) {
  5.             $object $this->build($concrete);
  6.         } else {
  7.             $object $this->make($concrete);
  8.         }
  9.         // If we defined any extenders for this type, we'll need to spin through them
  1.      *
  2.      * @throws \Illuminate\Contracts\Container\BindingResolutionException
  3.      */
  4.     public function make($abstract, array $parameters = [])
  5.     {
  6.         return $this->resolve($abstract$parameters);
  7.     }
  8.     /**
  9.      *  {@inheritdoc}
  10.      */
  1.             $this->{$method $this->availableBindings[$abstract]}();
  2.             $this->ranServiceBinders[$method] = true;
  3.         }
  4.         return parent::make($abstract$parameters);
  5.     }
  6.     /**
  7.      * Register container bindings for the application.
  8.      *
  1.             $uses .= '@__invoke';
  2.         }
  3.         [$controller$method] = explode('@'$uses);
  4.         if (! method_exists($instance $this->make($controller), $method)) {
  5.             throw new NotFoundHttpException;
  6.         }
  7.         if ($instance instanceof LumenController) {
  8.             return $this->callLumenController($instance$method$routeInfo);
  1.     protected function callActionOnArrayBasedRoute($routeInfo)
  2.     {
  3.         $action $routeInfo[1];
  4.         if (isset($action['uses'])) {
  5.             return $this->prepareResponse($this->callControllerAction($routeInfo));
  6.         }
  7.         foreach ($action as $value) {
  8.             if ($value instanceof Closure) {
  9.                 $callable $value->bindTo(new RoutingClosure);
  1.                 return $this->callActionOnArrayBasedRoute($this['request']->route());
  2.             }));
  3.         }
  4.         return $this->prepareResponse(
  5.             $this->callActionOnArrayBasedRoute($routeInfo)
  6.         );
  7.     }
  8.     /**
  9.      * Call the Closure or invokable on the array based route.
  1.             return $this->sendThroughPipeline($this->middleware, function ($request) use ($method$pathInfo) {
  2.                 $this->instance(Request::class, $request);
  3.                 if (isset($this->router->getRoutes()[$method.$pathInfo])) {
  4.                     return $this->handleFoundRoute([true$this->router->getRoutes()[$method.$pathInfo]['action'], []]);
  5.                 }
  6.                 return $this->handleDispatcherResponse(
  7.                     $this->createDispatcher()->dispatch($method$pathInfo)
  8.                 );
Application->Laravel\Lumen\Concerns\{closure}(object(Request))
  1.      */
  2.     protected function prepareDestination(BaseClosure $destination)
  3.     {
  4.         return function ($passable) use ($destination) {
  5.             try {
  6.                 return call_user_func($destination$passable);
  7.             } catch (Throwable $e) {
  8.                 return $this->handleException($passable$e);
  9.             }
  10.         };
  11.     }
Pipeline->Laravel\Lumen\Routing\{closure}(object(Request)) in /var/www/vhosts/dimater.weyop.com/fe/app/Http/Middleware/HabilitadaMiddleware.php (line 51)
  1.             $cookieStatus=new Cookie('dimater_company_status'$companyStatustime() + (30 60));
  2.             if ($companyStatus == 0) {
  3.                 return response(view('servicio_suspendido'))->cookie($cookieStatus);
  4.             }else{
  5.                 return $next($request)->withCookie($cookieStatus);
  6.             }
  7.         }
  8.         if ($companyStatus == 0) {
  9.             return view('servicio_suspendido');
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
Pipeline->Illuminate\Pipeline\{closure}(object(Request))
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return call_user_func($slice($stack$pipe), $passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
  1.     {
  2.         $pipeline array_reduce(
  3.             array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
  4.         );
  5.         return $pipeline($this->passable);
  6.     }
  7.     /**
  8.      * Run the pipeline and return the result.
  9.      *
  1.     {
  2.         if (count($middleware) > && ! $this->shouldSkipMiddleware()) {
  3.             return (new Pipeline($this))
  4.                 ->send($this->make('request'))
  5.                 ->through($middleware)
  6.                 ->then($then);
  7.         }
  8.         return $then($this->make('request'));
  9.     }
  1.                 }
  2.                 return $this->handleDispatcherResponse(
  3.                     $this->createDispatcher()->dispatch($method$pathInfo)
  4.                 );
  5.             });
  6.         } catch (Throwable $e) {
  7.             return $this->prepareResponse($this->sendExceptionToHandler($e));
  8.         }
  9.     }
  1.      * @param  SymfonyRequest|null  $request
  2.      * @return void
  3.      */
  4.     public function run($request null)
  5.     {
  6.         $response $this->dispatch($request);
  7.         if ($response instanceof SymfonyResponse) {
  8.             $response->send();
  9.         } else {
  10.             echo (string) $response;
  1. | the client's browser allowing them to enjoy the creative
  2. | and wonderful application we have prepared for them.
  3. |
  4. */
  5. $app->run();

Stack Trace

RequestException

Illuminate\Http\Client\RequestException:
HTTP request returned status code 502.

  at /var/www/vhosts/dimater.weyop.com/fe/vendor/illuminate/http/Client/Response.php:207
  at Illuminate\Http\Client\Response->throw()
     (/var/www/vhosts/dimater.weyop.com/fe/app/AppCustom/ClientCustom.php:32)
  at App\AppCustom\ClientCustom->httpRequest('get', 'secciones', array('menu' => 1, 'company_id' => '12'))
     (/var/www/vhosts/dimater.weyop.com/fe/app/Http/Controllers/Controller.php:46)
  at App\Http\Controllers\Controller->view_ready()
     (/var/www/vhosts/dimater.weyop.com/fe/app/Http/Controllers/ProductosController.php:16)
  at App\Http\Controllers\ProductosController->__construct()
  at ReflectionClass->newInstanceArgs(array())
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/illuminate/container/Container.php:849)
  at Illuminate\Container\Container->build('App\\Http\\Controllers\\ProductosController')
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/illuminate/container/Container.php:691)
  at Illuminate\Container\Container->resolve('App\\Http\\Controllers\\ProductosController', array())
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/illuminate/container/Container.php:637)
  at Illuminate\Container\Container->make('App\\Http\\Controllers\\ProductosController', array())
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/laravel/lumen-framework/src/Application.php:300)
  at Laravel\Lumen\Application->make('App\\Http\\Controllers\\ProductosController')
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:321)
  at Laravel\Lumen\Application->callControllerAction(array(true, array('as' => 'catalogo', 'uses' => 'App\\Http\\Controllers\\ProductosController@catalogo'), array()))
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:279)
  at Laravel\Lumen\Application->callActionOnArrayBasedRoute(array(true, array('as' => 'catalogo', 'uses' => 'App\\Http\\Controllers\\ProductosController@catalogo'), array()))
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:264)
  at Laravel\Lumen\Application->handleFoundRoute(array(true, array('as' => 'catalogo', 'uses' => 'App\\Http\\Controllers\\ProductosController@catalogo'), array()))
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:166)
  at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(object(Request))
  at call_user_func(object(Closure), object(Request))
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:48)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
     (/var/www/vhosts/dimater.weyop.com/fe/app/Http/Middleware/HabilitadaMiddleware.php:51)
  at App\Http\Middleware\HabilitadaMiddleware->handle(object(Request), object(Closure))
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
  at call_user_func(object(Closure), object(Request))
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/illuminate/pipeline/Pipeline.php:103)
  at Illuminate\Pipeline\Pipeline->then(object(Closure))
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:423)
  at Laravel\Lumen\Application->sendThroughPipeline(array('App\\Http\\Middleware\\HabilitadaMiddleware'), object(Closure))
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:172)
  at Laravel\Lumen\Application->dispatch(null)
     (/var/www/vhosts/dimater.weyop.com/fe/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:109)
  at Laravel\Lumen\Application->run()
     (/var/www/vhosts/dimater.weyop.com/fe/public/index.php:28)