Add error handling to Ruby code