Raises an exception if the Spark Cloud returned an error.

def _check_error(response):
        """Raises an exception if the Spark Cloud returned an error."""
        if (not response.ok) or (response.status_code != 200):
            raise Exception(
                response.json()['error'] + ': ' +
                response.json()['error_description']
            )