Skip to content

Commit 9cb6ada

Browse files
attempy to fix test_init_path_no_env_error)
1 parent 0f3150b commit 9cb6ada

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

python/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,13 @@ impl OntoEnv {
278278
Some(found_root) => OntoEnvRs::load_from_directory(found_root, read_only)
279279
.map_err(anyhow_to_pyerr)?,
280280
None => {
281+
// If a specific path was provided but no .ontoenv exists, raise error
282+
if path.is_some() {
283+
return Err(PyValueError::new_err(format!(
284+
"OntoEnv directory not found at: \"{}\"",
285+
root_path.join(".ontoenv").display()
286+
)));
287+
}
281288
if read_only {
282289
return Err(PyErr::new::<pyo3::exceptions::PyValueError, _>(format!(
283290
"OntoEnv directory not found at: \"{}\" and read_only=True",

0 commit comments

Comments
 (0)