Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
PhpStorm 2015.1.2 and PHP 7 - Error on index.php
  • The thrown object must be an instance of the Exception or throwable. throw $e;

    // Exception route processing closure
    $routerequest = function($request = null, $e = false)
    {
    Request::reset_request(true);

    $route = array_key_exists($request, Router::$routes) ? Router::$routes[$request]->translation : Config::get('routes.'.$request);

    if ($route instanceof Closure)
    {
    $response = $route();

    if( ! $response instanceof Response)
    {
    $response = Response::forge($response);
    }
    }
    elseif ($e === false)
    {
    $response = Request::forge()->execute()->response();
    }
    elseif ($route)
    {
    $response = Request::forge($route, false)->execute(array($e))->response();
    }
    elseif ($request)
    {
    $response = Request::forge($request)->execute(array($e))->response();
    }
    else
    {
    throw $e; // ERROR HERE!!!
    }

    return $response;
    };


  • If would be interesting to know what $e is, because it can't be something else, the closure is called only below it's definition, and in all cases an Exception object is passed.
  • The thrown object must be an instance of the Exception or throwable.
    That's the error that PhpStorm 2016.1.2 is giving, it puts a red error on it and the index.php file show a red line under it.

  • Darn the form keeps saying xml error but it is still posting sorry for that please delete the others.

  • Image of the error:

    image
  • HarroHarro
    Accepted Answer
    Oh, wait. It's not a Fuel issue, it is a problem with PHPstorms syntax checker. It can't know whether or not $e contains something throwable, as it is passed to the function as an argument.

    the xml issue we have to look at, it might be caused by the server move yesterday.
  • HarroHarro
    Accepted Answer
    The xml issue should be fixed. The error was misleading, it was actually the backend that got a timeout on the spam-check on your IP due to a configuration that still used the IP of the old server.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion