diff --git a/kadmos/graph/graph_kadmos.py b/kadmos/graph/graph_kadmos.py index 8c56f62a4d8254ac759b498e21dea9cf53aa0f01..8562cf4c77fd8bea9e7dd0c1d373e73bda75a725 100644 --- a/kadmos/graph/graph_kadmos.py +++ b/kadmos/graph/graph_kadmos.py @@ -4609,7 +4609,8 @@ def _check_roots(io_list): logger.debug('Inconsistent root of element found in XML file {}'.format(file_name)) logger.debug('Inconsistent root: {}'.format(current_root.tag)) logger.debug('Inconsistent w.r.t. standard root: {}'.format(previous_root.tag)) - raise IOError('Inconsistent root') + raise IOError('Inconsistent root in file {} (root found: {}, expected root: {})' + .format(file_name, current_root.tag, previous_root.tag)) previous_root = current_root first_file = False return @@ -4648,6 +4649,7 @@ def _get_leafs(io_list): leafs = list(leafs) return leafs + def _check_leafs(io_list, leafs): """ This function checks if there are elements in other files with the same element that still have child elements. @@ -4671,6 +4673,7 @@ def _check_leafs(io_list, leafs): leafs.remove(leaf) return + def parse_check(io_list): logger.info('Checking for parsing errors...') for entry in io_list: @@ -4687,5 +4690,5 @@ def _try_parsing(file_path): logger.debug('Could not parse XML file {}. Check file structure.'.format(os.path.split(file_path)[1])) logger.debug('To avoid parser errors, use an XML editor to build and adjust files.') logger.warning('ERROR: {}'.format(e)) - raise + raise IOError('Could not parse XML file {}. Check file structure.'.format(os.path.split(file_path)[1])) return tree