I'm trying to make a php command using symfony to connect through ssh to a server.
It's all okay, but if i can't connect to server (server unreachable) i take this error :

```
[Symfony\Component\Debug\Exception\ContextErrorException]             
Warning: ssh2_connect(): Unable to connect to skin-master on port 22  

```

This is okay but if i try to catch the error doing something like this:

```
try{
                $exec=$this->ssh_connect($cinema);
            }
            catch(\Exception $e){
                echo $e;
                $this->no_connection($em,$cinema);
                continue;

```

I continue to have the error so i can't control this exception.
How can I do this?
Thanks :)