Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _raise_on_error(data):
"""Check response for error message."""
if isinstance(data, list) and data:
data = data[0]
if isinstance(data, dict) and "error" in data:
raise_error(data["error"])
def _raise_on_error(data):
"""Check response for error message."""
if isinstance(data, list) and data:
data = data[0]
if isinstance(data, dict) and "error" in data:
raise_error(data["error"])