1

I am trying to use suds (version 0.6) to connect to a web service,

from suds.client import Client
client = Client(SOAP_URL, timeout=10)

now I sometimes get timeout error, so I am wondering how to catch all errors using suds when connecting to a web service, and so then in the catch block I can reconnect the web service.

daiyue
  • 7,196
  • 25
  • 82
  • 149

1 Answers1

1

It looks as though all of their errors inherit from Exception so to catch all of the errors, you will need to catch this type of error

Otherwise you can look through their documentation and choose which exceptions you want to handle seperately.

try:
    client = Client(SOAP_URL, timeout=10)
except Exception:
    #enter code to reconnect here
    print("Catch block for creating a client connection")
Alan Kavanagh
  • 9,425
  • 7
  • 41
  • 65