def METHOD_NAME(database_id, operation):
    from logical.models import Database
    database = Database.objects.get(id=database_id)
    url = _get_database_error_url(database_id)
    if database.is_dead:
        raise DatabaseIsDeadError(operation, url)
    return database