proper handling of errors: reopen connections
update gems