2

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

Arnold Roa
  • 7,335
  • 5
  • 50
  • 69

2 Answers2

0

I found the way after a bit of testing:

rescue SOAP::FaultError => e
    if e.message == "MS_UNAVAILABLE"
      # @ToDO handle service unavailable exception
    end
end
Arnold Roa
  • 7,335
  • 5
  • 50
  • 69
0

Ran into a similar issue. This might be of use to you:

MS_UNAVAILABLE means that: "The Member State service is unavailable, try again later or with another Member State".

serenesat
  • 4,611
  • 10
  • 37
  • 53
kardolus
  • 173
  • 12