throws custom errors when root or object_root is missing