error handling in ruby driver.