Handling "Type IOError has no field status" with some delay

I make regular calls to an API. Sometimes the call results in the error “type IOError has no field status”. Rather than my script stopping, I would like to handle that error and permit the script to continue.

What is the best way to handle the stated error, if I am interested in the script waiting some time before attempting again?

You probably want a try/catch block:


type IOError has no field status

This is a very strange error of the API. It seems like it has thrown a IOError for some reason, captured the error, and tried to access a nonexistent field in the IOError, as it was expecting other type of error object in that context and did not check if the raised error was of the expected type.