Let's say I have the following code snippet.
To verify this, I change the IP address of the server to simulate error messages. The IP below does not exist, therefore the message Unhandled Exception : Cannot connect to 10.199.1.7. Error 113. No route to host Cannot connect to 10.199.1.7. Error 113. No route to host
Displays an ugly screen with PHP code. Can this error be caught?
try { $ssh = new Net_SSH2('10.199.1.7'); if (!$ssh->login('deploy', $key)) { throw new Exception("Failed login"); } } catch (Exception $e) { ??? }
source share