@@ -63,14 +63,14 @@ def __init__(self, filename, schema_as_string=None, schema=None, file_format=Non
6363 self .appending_to_schema = True
6464 if not self ._schema .with_standard :
6565 raise HedFileError (
66- HedExceptions .SCHEMA_DUPLICATE_PREFIX ,
66+ HedExceptions .SCHEMA_LOAD_FAILED ,
6767 "Loading multiple normal schemas as a merged one with the same namespace. "
6868 "Ensure schemas have the withStandard header attribute set" ,
6969 self .name ,
7070 )
7171 elif with_standard != self ._schema .with_standard :
7272 raise HedFileError (
73- HedExceptions .BAD_WITH_STANDARD_MULTIPLE_VALUES ,
73+ HedExceptions .SCHEMA_LOAD_FAILED ,
7474 f"Merging schemas requires same withStandard value ({ with_standard } != { self ._schema .with_standard } )." ,
7575 self .name ,
7676 )
@@ -125,7 +125,7 @@ def _load(self):
125125 base_version = load_schema_version (self ._schema .with_standard , check_prerelease = self .check_prerelease )
126126 except HedFileError as e :
127127 raise HedFileError (
128- HedExceptions .BAD_WITH_STANDARD ,
128+ HedExceptions .SCHEMA_LIBRARY_INVALID ,
129129 message = f"Cannot load withStandard schema '{ self ._schema .with_standard } '" ,
130130 filename = e .filename ,
131131 ) from e
@@ -194,36 +194,36 @@ def find_rooted_entry(tag_entry, schema, loading_merged):
194194 if rooted_tag is not None :
195195 if not schema .with_standard :
196196 raise HedFileError (
197- HedExceptions .ROOTED_TAG_INVALID ,
197+ HedExceptions .SCHEMA_ATTRIBUTE_INVALID ,
198198 f"Rooted tag attribute found on '{ tag_entry .short_tag_name } ' in a standard schema." ,
199199 schema .name ,
200200 )
201201
202202 if not isinstance (rooted_tag , str ):
203203 raise HedFileError (
204- HedExceptions .ROOTED_TAG_INVALID ,
204+ HedExceptions .SCHEMA_LIBRARY_INVALID ,
205205 f"Rooted tag '{ tag_entry .short_tag_name } ' is not a string.\" " ,
206206 schema .name ,
207207 )
208208
209209 if tag_entry .parent_name and not loading_merged :
210210 raise HedFileError (
211- HedExceptions .ROOTED_TAG_INVALID ,
211+ HedExceptions .SCHEMA_LIBRARY_INVALID ,
212212 f"Found rooted tag '{ tag_entry .short_tag_name } ' as a non root node." ,
213213 schema .name ,
214214 )
215215
216216 if not tag_entry .parent_name and loading_merged :
217217 raise HedFileError (
218- HedExceptions .ROOTED_TAG_INVALID ,
218+ HedExceptions .SCHEMA_LIBRARY_INVALID ,
219219 f"Found rooted tag '{ tag_entry .short_tag_name } ' as a root node in a merged schema." ,
220220 schema .name ,
221221 )
222222
223223 rooted_entry = schema .tags .get (rooted_tag )
224224 if not rooted_entry or rooted_entry .has_attribute (constants .HedKey .InLibrary ):
225225 raise HedFileError (
226- HedExceptions .ROOTED_TAG_DOES_NOT_EXIST ,
226+ HedExceptions .LIBRARY_SCHEMA_INVALID ,
227227 f"Rooted tag '{ tag_entry .short_tag_name } ' not found in paired standard schema" ,
228228 schema .name ,
229229 )
0 commit comments