diff --git a/kadmos/graph/graph_kadmos.py b/kadmos/graph/graph_kadmos.py
index 8562cf4c77fd8bea9e7dd0c1d373e73bda75a725..70983f94a4e91c2d1fe86b27609721cf44ad3cf2 100644
--- a/kadmos/graph/graph_kadmos.py
+++ b/kadmos/graph/graph_kadmos.py
@@ -4671,6 +4671,9 @@ def _check_leafs(io_list, leafs):
                         logger.debug('Invalid leaf element path {}'.format(leaf[1]))
                         logger.debug('Reason for invalidity: longer path {} found in file {}'.format(path, file_name))
                         leafs.remove(leaf)
+                        raise AssertionError('Invalid leaf element found in XML file {}\n'.format(leaf[2]) +
+                                             'Invalid leaf element path {}\n'.format(leaf[1]) +
+                                             'Reason for invalidity: longer path {} found in file {}'.format(path, file_name))
     return