I added two new commits which I think are closer to how you've suggested I should implemented given the fact that I no longer catch the entire block and using the bare Exception.
I had to use both KeyError and AttributeError since in the case of my test I got an AttributeError