Fix bug of breaking all of the remainings when one of the hosts fails

1. catch and handle possible exceptions raised when executing queries
2. log the errors and keep the remainings running