def _check_result(self, response, result):
        try:
            error = result.get('error', None)
            reason = result.get('reason', None)
        except __HOLE__:
            error = None
            reason = ''

        # This is here because couchdb can return http 201
        # but containing a list of conflict errors
        if error == 'conflict' or error == "file_exists":
            raise exceptions.Conflict(reason or "Conflict")

        if response.status_code > 205:
            if response.status_code == 404 or error == 'not_found':
                raise exceptions.NotFound(reason or 'Not found')
            elif error == 'bad_request':
                raise exceptions.BadRequest(reason or "Bad request")
            raise exceptions.GenericError(result)
dataset/ETHPy150Open histrio/py-couchdb/pycouchdb/resource.py/Resource._check_result