Skip to content

Commit d3c4fab

Browse files
committed
Merge branch 'ChristianTremblay-error-messages'
2 parents 421858c + 66d438d commit d3c4fab

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/src/ontology.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl OntologyLocation {
185185
OntologyLocation::File(p) => {
186186
// Use the Url crate, just like in the Display impl
187187
let iri = Url::from_file_path(p)
188-
.expect("Failed to create file URL for IRI")
188+
.expect("Failed to create file URL for IRI. Try removing .ontoenv folder as it may contain corrupted or improperly formatted file paths. Then recreate the environment.")
189189
.to_string();
190190
NamedNode::new(iri).unwrap()
191191
}

python/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ impl OntoEnv {
238238
if path.is_none() && root == "." && !recreate && !temporary {
239239
// Use forward slashes for cross-platform compatibility in error messages
240240
return Err(PyValueError::new_err(
241-
"OntoEnv directory not found at: \"./.ontoenv\""
241+
"OntoEnv directory not found at \"./.ontoenv\". You must provide a valid path or set recreate=True or temporary=True to create a new OntoEnv.",
242242
));
243243
}
244244
let mut root_path = path.clone().unwrap_or_else(|| PathBuf::from(root));

python/tests/test_ontoenv_init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_init_no_config_no_path_error(self):
7575
os.remove(".ontoenv")
7676
else:
7777
shutil.rmtree(".ontoenv")
78-
with self.assertRaisesRegex(ValueError, "OntoEnv directory not found at: \"./.ontoenv\""):
78+
with self.assertRaisesRegex(ValueError, "OntoEnv directory not found at \"./.ontoenv\". You must provide a valid path or set recreate=True or temporary=True to create a new OntoEnv."):
7979
OntoEnv() # No args
8080

8181
def test_init_path_no_env_error(self):

0 commit comments

Comments
 (0)