`DoesNotExist` is not a subclass of `DatabaseError`, so we should catch it separately here.