throw error when calling generator with non-existing file
As written by @hjirovska in this thread:
There was one thing I ran into when I was playing around with the code – if one creates the generator and tries to get the
NetworkConfiguration
object like thisgenerator = netconf_generator("example.yaml", builders=[component_builder, NetworkBuilder()], linkers=[NetworkLinker()]) network_configuration = next(generator)
in the case that "example.yaml" file doesn't exist, a
FileNotFoundError
is raised only during thenext(generator)
call. Is this the behaviour we want? Or do we want that to be checked already when one calls thenetconf_generator()
method?
We probably indeed want the error to be thrown right away, however this may be not very straightforward to implement as the code in the function is not executed until next
is called.
Edited by Guus