Shouldn't Cache Work with Try and Except?

Hey everyone,

I have a function that depends on an external engineering software. In that function, there may be a attribute named “group” or not. I am OK with it. I have placed everything about getting the group info in a try except block.

It takes too much time, so I have tried to cached it. But since this function will usually fail and go to except part, cache gives me the error based on the current situation. Is that how it works? So, in case of functions that will work only some time, using cache is impossible. Am I right?