def test_array_index_out_of_range(editor: ArtifactEditorToolSpec):
    """Test error handling for array index out of range."""
    editor.create_artifact(name="John", age=30, tags=["python"])

    patch = JsonPatch(
        operations=[PatchOperation(op="replace", path="/tags/5", value="test")]
    )

    with pytest.raises(ValueError, match="Failed to apply operation"):
        editor.apply_patch(patch)
Test error handling for array index out of range.
llama-index-integrations/tools/llama-index-tools-artifact-editor/tests/test_artifact_editor.py