Ruby How to know what to rescue?
问题 I'm using eurovat gem to check a VAT number. Eurovat.check_vat_number vat_number If I run that from irb, sometimes I receive this: SOAP::FaultError: MS_UNAVAILABLE from (Nothing appear after "from") I want to write a begin rescue block to rescue those error, but how I do know what to rescue? I have tried with rescue SOAP::FaultError but didn't works 回答1: I found the way after a bit of testing: rescue SOAP::FaultError => e if e.message == "MS_UNAVAILABLE" # @ToDO handle service unavailable