# Status of sftp/ssh connection. Retrieve error-msgs

**URL:** <https://www.ruby-forum.com/t/status-of-sftp-ssh-connection-retrieve-error-msgs/189168>\
**Category:** Ruby\
**Created:** [May 25, 2010, 9:54pm UTC](https://www.ruby-forum.com/t/status-of-sftp-ssh-connection-retrieve-error-msgs/189168 "2010-05-25T21:54:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![walle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/5daacb/32.png) [@walle](https://www.ruby-forum.com/u/walle)\
**Post date:** [May 25, 2010, 9:54pm UTC](https://www.ruby-forum.com/t/status-of-sftp-ssh-connection-retrieve-error-msgs/189168/1 "2010-05-25T21:54:04Z")

</div>

Hey, I’m trying to determent the status of a sftp and ssh connection to  
a specific server. I’m currently using Net::SFTP and Net::SSH. Is there  
any similar way of doing this as with the Net::Http, were I’m using  
Net::Http.get\_response().code.

I would like to extract the server response,  
“Net::SSH::AuthenticationFailed” etc without using rescue.

Any idea?

//Walle
