I didn't saw it at first, but next line is "raise". That mean the user see the error. This try..except give extra information in case of bug. I think it is not bad to keep this. So I would arg to keep this like that and don't change the other place.

I have one questions that I'm not sure, should we keep the logger level to debug? or change it to warn? Or add it to the error message?

I don't think that we should warn about it by default. This could pollute the output in tests for example. So I would prefer that we keep the debug level or that we add that information in the error message. So if the user catch it, he won't see it, but if the user don't catch the error, he will see it. Comments?