I know the original doesn't use it, but there is some syntactic sugar here you could use:

```
def attempt_connection
  # ... do stuff
rescue Exception => e
  # handle it
end
```