79831191

Date: 2025-11-26 22:18:42
Score: 1
Natty:
Report link

Got internet issues right now. I'll post the type / reponse later. But this my code around the error.

try:
    req = requests.get(url, params=params, headers=self.headers)
    req.raise_for_status() # print None
    res = req.json()
except Exception:
    logger.exception(f"Failed to fetch")
    return None

if res is None: # aka NoneType
    logger.warning(f"No data found")
    return None

data = res.get("key", {}) # AttributeError
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Capeya