2 ms·
Why are people writing Python like it's Go? Letting the KeyError go is usually fine, but if you want to log it or can recover somehow then: try: API
by globular-toast 1y ago
Why are people writing Python like it's Go?
Letting the KeyError go is usually fine, but if you want to log it or can recover somehow then:
try:
API_KEY = os.environ["API_KEY"]
except KeyError:
logger.exception("...")
...