Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def try_to_describe_indexer_env(env):
""" Small helper that wraps beanstalk_info so we can recover from exceptions
XXX: Fix beanstalk_info so it will not throw IndexError if you give it bad env
"""
try:
return beanstalk_info(env)
except IndexError:
return None # env does not exist
except Exception:
raise # something else happened we should (probably) raise