How to use the pydeconz.errors.raise_error function in pydeconz

To help you get started, we’ve selected a few pydeconz examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Kane610 / deconz / pydeconz / gateway.py View on Github external
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"])
github Kane610 / deconz / pydeconz / utils.py View on Github external
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"])