Exemple #1
0
 /**
  * {@inheritDoc}
  */
 public function handleException(Exception $proposedException)
 {
     // The Twig runtime error is not very useful
     if ($proposedException instanceof Twig_Error_Runtime && ($previousException = $proposedException->getPrevious()) && !$previousException instanceof CmsException) {
         $proposedException = $previousException;
     }
     return parent::handleException($proposedException);
 }
 /**
  * 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 {
         return $next($request);
     } catch (\Exception $ex) {
         if (!\Request::ajax()) {
             throw $ex;
         }
         $debugbar->addException($ex);
         $message = $ex instanceof AjaxException ? $ex->getContents() : \October\Rain\Exception\ErrorHandler::getDetailedMessage($ex);
         return \Response::make($message, $this->getStatusCode($ex), $debugbar->getDataAsHeaders());
     }
 }
 /**
  * Removes the active mask from the called class.
  * @return void
  */
 public static function unmask()
 {
     ErrorHandler::removeMask();
 }