FOSSBilling \ Exception
News item not found FOSSBilling\Exception thrown with message "News item not found" Stacktrace: #7 FOSSBilling\Exception in /www/wwwroot/idc.lc/modules/News/Api/Guest.php:61 #6 Box\Mod\News\Api\Guest:get in /www/wwwroot/idc.lc/library/Api/Handler.php:108 #5 Api_Handler:__call in /www/wwwroot/idc.lc/modules/News/Controller/Client.php:41 #4 Box\Mod\News\Controller\Client:get_news_item in [internal]:0 #3 ReflectionMethod:invokeArgs in /www/wwwroot/idc.lc/library/Box/App.php:187 #2 Box_App:executeShared in /www/wwwroot/idc.lc/library/Box/App.php:316 #1 Box_App:processRequest in /www/wwwroot/idc.lc/library/Box/App.php:129 #0 Box_App:run in /www/wwwroot/idc.lc/index.php:89
Stack frames (8)
7
FOSSBilling\Exception
/modules/News/Api/Guest.php:61
6
Box\Mod\News\Api\Guest get
/library/Api/Handler.php:108
5
Api_Handler __call
/modules/News/Controller/Client.php:41
4
Box\Mod\News\Controller\Client get_news_item
[internal]:0
3
ReflectionMethod invokeArgs
/library/Box/App.php:187
2
Box_App executeShared
/library/Box/App.php:316
1
Box_App processRequest
/library/Box/App.php:129
0
Box_App run
/index.php:89
/www/wwwroot/idc.lc/modules/News/Api/Guest.php
     *
     * @return array
     */
    public function get($data)
    {
        if (!isset($data['id']) && !isset($data['slug'])) {
            throw new \FOSSBilling\Exception('ID or slug is missing');
        }
 
        $id = $data['id'] ?? null;
        $slug = $data['slug'] ?? null;
 
        if ($id) {
            $model = $this->getService()->findOneActiveById($id);
        } else {
            $model = $this->getService()->findOneActiveBySlug($slug);
        }
 
        if (!$model || $model->status !== 'active') {
            throw new \FOSSBilling\Exception('News item not found');
        }
 
        return $this->getService()->toApiArray($model);
    }
}
 
Arguments
  1. "News item not found"
    
/www/wwwroot/idc.lc/library/Api/Handler.php
        }
 
        $bb_mod = $this->di['mod']($mod);
 
        $api->setDi($this->di);
        $api->setMod($bb_mod);
        $api->setIdentity($this->identity);
        $api->setIp($this->di['request']->getClientIp());
        if ($bb_mod->hasService()) {
            $api->setService($this->di['mod_service']($mod));
        }
 
        if (!method_exists($api, $method_name) || !is_callable([$api, $method_name])) {
            $reflector = new ReflectionClass($api);
            if (!$reflector->hasMethod('__call')) {
                throw new FOSSBilling\Exception(':type API call :method does not exist in module :module', [':type' => ucfirst($this->type), ':method' => $method_name, ':module' => $mod], 740);
            }
        }
 
        return $api->{$method_name}($arguments);
    }
}
 
/www/wwwroot/idc.lc/modules/News/Controller/Client.php
 
    public function getDi(): ?\Pimple\Container
    {
        return $this->di;
    }
 
    public function register(\Box_App &$app)
    {
        $app->get('/news', 'get_news', [], static::class);
        $app->get('/news/:slug', 'get_news_item', ['slug' => '[a-z0-9-]+'], static::class);
    }
 
    public function get_news(\Box_App $app)
    {
        return $app->render('mod_news_index');
    }
 
    public function get_news_item(\Box_App $app, $slug)
    {
        $post = $this->di['api_guest']->news_get(['slug' => $slug]);
 
        return $app->render('mod_news_post', ['post' => $post]);
    }
}
 
[internal]
/www/wwwroot/idc.lc/library/Box/App.php
    {
        $this->debugBar['time']->startMeasure('executeShared', 'Reflecting module controller (shared mapping)');
        $class = new $classname();
        if ($class instanceof InjectionAwareInterface) {
            $class->setDi($this->di);
        }
        $reflection = new ReflectionMethod($class::class, $methodName);
        $args = [];
        $args[] = $this; // first param always app instance
 
        foreach ($reflection->getParameters() as $param) {
            if (isset($params[$param->name])) {
                $args[$param->name] = $params[$param->name];
            } elseif ($param->isDefaultValueAvailable()) {
                $args[$param->name] = $param->getDefaultValue();
            }
        }
        $this->debugBar['time']->stopMeasure('executeShared');
 
        return $reflection->invokeArgs($class, $args);
    }
 
    protected function execute($methodName, $params, $classname = null): string
    {
        $this->debugBar['time']->startMeasure('execute', 'Reflecting module controller');
 
        $reflection = new ReflectionMethod(static::class, $methodName);
        $args = [];
 
        foreach ($reflection->getParameters() as $param) {
            if (isset($params[$param->name])) {
                $args[$param->name] = $params[$param->name];
            } elseif ($param->isDefaultValueAvailable()) {
                $args[$param->name] = $param->getDefaultValue();
            }
        }
 
        $this->debugBar['time']->stopMeasure('execute');
 
        return $reflection->invokeArgs($this, $args);
/www/wwwroot/idc.lc/library/Box/App.php
                    $exc = new FOSSBilling\InformationException('The system is undergoing maintenance. Please try again later', [], 503);
                    $apiController = new Box\Mod\Api\Controller\Client();
                    $apiController->setDi($this->di);
 
                    return $apiController->renderJson(null, $exc);
                } else {
                    return $this->render('mod_system_maintenance');
                }
            }
        }
 
        $this->debugBar['time']->startMeasure('sharedMapping', 'Checking shared mappings');
        $sharedCount = count($this->shared);
        for ($i = 0; $i < $sharedCount; ++$i) {
            $mapping = $this->shared[$i];
            $url = new Box_UrlHelper($mapping[0], $mapping[1], $mapping[3], $this->url);
            if ($url->match) {
                $this->debugBar['time']->stopMeasure('sharedMapping');
 
                return $this->executeShared($mapping[4], $mapping[2], $url->params);
            }
        }
        $this->debugBar['time']->stopMeasure('sharedMapping');
 
        // this class mappings
        $this->debugBar['time']->startMeasure('mapping', 'Checking mappings');
        $mappingsCount = count($this->mappings);
        for ($i = 0; $i < $mappingsCount; ++$i) {
            $mapping = $this->mappings[$i];
            $url = new Box_UrlHelper($mapping[0], $mapping[1], $mapping[3], $this->url);
            if ($url->match) {
                $this->debugBar['time']->stopMeasure('mapping');
 
                return $this->execute($mapping[2], $url->params);
            }
        }
        $this->debugBar['time']->stopMeasure('mapping');
 
        $e = new FOSSBilling\InformationException('Page :url not found', [':url' => $this->url], 404);
 
/www/wwwroot/idc.lc/library/Box/App.php
    public function delete(string $url, string $methodName, ?array $conditions = [], ?string $class = null): void
    {
        $this->event('delete', $url, $methodName, $conditions, $class);
    }
 
    public function run(): string
    {
        $this->debugBar['time']->startMeasure('registerModule', 'Registering module routes');
        $this->registerModule();
        $this->debugBar['time']->stopMeasure('registerModule');
 
        $this->debugBar['time']->startMeasure('init', 'Initializing the app');
        $this->init();
        $this->debugBar['time']->stopMeasure('init');
 
        $this->debugBar['time']->startMeasure('checkperm', 'Checking access to module');
        $this->checkPermission();
        $this->debugBar['time']->stopMeasure('checkperm');
 
        return $this->processRequest();
    }
 
    /**
     * @param string $path
     */
    public function redirect($path): never
    {
        $location = $this->di['url']->link($path);
        header("Location: $location");
        exit;
    }
 
    public function render($fileName, $variableArray = []): string
    {
        return 'Rendering ' . $fileName;
    }
 
    public function sendFile($filename, $contentType, $path): false|int
    {
        header("Content-type: $contentType");
/www/wwwroot/idc.lc/index.php
 
// If HTTP error code has been passed, handle it.
if (!is_null($http_err_code)) {
    switch ($http_err_code) {
        case '404':
            $e = new FOSSBilling\Exception('Page :url not found', [':url' => $url], 404);
            echo $app->show404($e);
 
            break;
        default:
            $http_err_code = intval($http_err_code);
            http_response_code($http_err_code);
            $e = new FOSSBilling\Exception('HTTP Error :err_code occurred while attempting to load :url', [':err_code' => $http_err_code, ':url' => $url], $http_err_code);
            echo $app->render('error', ['exception' => $e]);
    }
    exit;
}
 
// If no HTTP error passed, run the app.
echo $app->run();
exit;
 

Environment & details:

Key Value
PHP Version
"8.4.7"
Error code
0
Instance ID
"7586314b-7782-480c-8fc4-e2211b66f1ad"
Key Value
_url
"/news/4"
empty
empty
empty
empty
Key Value
USER
"www"
HOME
"/home/www"
HTTP_ACCEPT_ENCODING
"gzip, br, zstd, deflate"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
HTTP_ACCEPT
"*/*"
PATH_INFO
"/news/4"
HTTP_HOST
"www.idc.lc"
REDIRECT_STATUS
"200"
SERVER_NAME
"idc.lc"
SERVER_PORT
"443"
SERVER_ADDR
"10.0.0.81"
REMOTE_PORT
"28574"
REMOTE_ADDR
"216.73.216.114"
SERVER_SOFTWARE
"nginx/1.26.3"
GATEWAY_INTERFACE
"CGI/1.1"
HTTPS
"on"
REQUEST_SCHEME
"https"
SERVER_PROTOCOL
"HTTP/1.1"
DOCUMENT_ROOT
"/www/wwwroot/idc.lc"
DOCUMENT_URI
"/index.php/news/4"
REQUEST_URI
"/news/4"
SCRIPT_NAME
"/index.php"
CONTENT_LENGTH
""
CONTENT_TYPE
""
REQUEST_METHOD
"GET"
QUERY_STRING
""
SCRIPT_FILENAME
"/www/wwwroot/idc.lc/index.php"
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php/news/4"
REQUEST_TIME_FLOAT
1765760082.3386
REQUEST_TIME
1765760082
empty
0. Whoops\Handler\PrettyPageHandler