Improve error management on getwork connections