this try-except block exists primarily because many tests are not correctly mocked, not other reasons, please fix that tests instead of increase the code pollution.