We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Unable to catch Redis cache exception

Hi, please consider these codes

    $frontCache = new FrontData([
        'lifetime' => \Simpledom\Core\Classes\Config::GetCacheLifetime()
    ]);

    // Create the Cache setting redis connection options
    $cache = new Redis($frontCache, [
        'host' => "127.0.0.1"
        'port' => 2020,
        'persistent' => false,
        'index' => 0,
    ]);

    // consider redis take down befor executing the following line
    $cache ->save('my-data', [1, 2, 3, 4, 5])

the problem with the save method is that it does not throw any catchable exception and It only shows : Could not connect to the Redisd server and do nto allow the application to continue

please consider adding exception for save, get, etc methods and also make afunction to know wheter the redis is Up or Down

regards

Create issue on github.