Handle connection error with beanstalk