return an error class from a socket.error