How can I catch Zlib::BufError in my Ruby on Rails code? -
i have built app rails. have large list of addresses standardizing via bing/google api using geocoder. current call adddress info:
geocoder.search(address)
this works fine , can parse response json. when leave script running falls on following error:
zlib::buferror: buffer error
instead of script falling on catch error , continue script. how ruby? not sure exception catch, if any.
to ensure zlib
available, need require 'zlib'
in file want catch error. doesn't geocoder
has declared dependency anywhere, may not loaded when rescue
line being evaluated.
require 'zlib' begin geocoder.search('110 william st, 28th floor new york, ny 10038') rescue zlib::buferror => boom puts 'stack overflow appears have moved.' end
Comments
Post a Comment