Photo by Neil Thomas on Unsplash

Exception handling in Ruby and life

*** WATSON ERROR *** Image Analyzer error Error: , Code: , Information: {"images"=>[{"source_url"=>"http://localhost:3000/artwork/artists/threecee/images/technoMask.png", "resolved_url"=>"http://localhost:3000/artwork/artists/threecee/images/technoMask.png", "error"=>{"code"=>400, "description"=>"URL Fetcher error: Could not fetch URL: Disallowed Hostname specified", "error_id"=>"input_error"}}], "images_processed"=>1}, X-dp-watson-tran-id: 79774ff5-3c6a-4661-894b-e101551ce9bd, X-global-transaction-id: 79774ff5-3c6a-4661-894b-e101551ce9bd
response = SomeApiThatWillThrowAnErrorSometimes(args)
rescue StandardError => error
puts "Hey! Something went sideways: #{error.message}"
return error

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store