It doesn't seem like one can catch Memcache exception
PHP Fatal error: Uncaught exception 'Phalcon\Cache\Exception' with message 'Cannot connect to Memcached server' in phalcon/cache/backend/memcache.zep:113
This is what I am currently doing:
$frontCache = new Data(array(
'lifetime' => 0
));
try {
$service = new Memcache($frontCache, array(
'host' => $host,
'port' => $port,
'persistent' => $persistent
));
}
catch (\Exception $e) // also tried with \Phalcon\Cache\Exception
{
}
return $service;
There should be a way for phalcon/cache/backend/memcache.zep to pass on the exception back to caller so it can be handled in userland.
OR am I simply not catching it correctly?