Exemplo n.º 1
0
 public function handle($request, \Closure $next)
 {
     try {
         return $next($request);
     } catch (\Exception $e) {
         $this->exceptionHandler->report($e);
         throw $e;
     }
 }
Exemplo n.º 2
0
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     /** @var \Barryvdh\Debugbar\LaravelDebugbar $debugbar */
     $debugbar = $this->app['debugbar'];
     try {
         /** @var \Illuminate\Http\Response $response */
         $response = $next($request);
     } catch (\Exception $e) {
         $debugbar->addException($e);
         $this->exceptionHandler->report($e);
         $response = $this->exceptionHandler->render($request, $e);
     }
     return $debugbar->modifyResponse($request, $response);
 }
Exemplo n.º 3
0
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     /** @var \Barryvdh\Debugbar\LaravelDebugbar $debugbar */
     $debugbar = $this->app['debugbar'];
     try {
         /** @var \Illuminate\Http\Response $response */
         $response = $next($request);
     } catch (\Exception $e) {
         $debugbar->addException($e);
         $this->exceptionHandler->report($e);
         $response = $this->exceptionHandler->render($request, $e);
     }
     $collected = $debugbar->collect();
     $storage = $debugbar->getStorage();
     Log::info('debugbar', compact('collected', 'storage'));
     return $response;
 }
Exemplo n.º 4
0
 /**
  * Handle an incoming request. Based on Asm89\Stack\Cors by asm89
  * @see https://github.com/asm89/stack-cors/blob/master/src/Asm89/Stack/Cors.php
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->isSameDomain($request) || !$this->cors->isCorsRequest($request)) {
         return $next($request);
     }
     if (!$this->cors->isActualRequestAllowed($request)) {
         abort(403);
     }
     try {
         /** @var \Illuminate\Http\Response $response */
         $response = $next($request);
     } catch (\Exception $e) {
         $this->exceptionHandler->report($e);
         $response = $this->exceptionHandler->render($request, $e);
     }
     return $this->cors->addActualRequestHeaders($response, $request);
 }
Exemplo n.º 5
0
 /**
  * Render an exception to the console.
  *
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  * @param \Exception                                        $exception
  *
  * @return mixed
  */
 public function renderForConsole($output, Exception $exception)
 {
     return $this->parentHandler->renderForConsole($output, $exception);
 }
 /**
  * Render an exception to the console.
  *
  * @param  \Symfony\Component\Console\Output\OutputInterface $output
  * @param  \Exception $e
  * @return void
  */
 public function renderForConsole($output, Exception $e)
 {
     $this->laravelExceptionHandler->renderForConsole($output, $e);
 }
Exemplo n.º 7
0
 /**
  * Render an exception to the console.
  *
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  * @param \Exception                                        $e
  */
 public function renderForConsole($output, Exception $e)
 {
     if (is_null($this->exceptionHandler) === false) {
         $this->exceptionHandler->renderForConsole($output, $e);
     }
 }