empty model in instant and deferred modes print RuntimeError message
Running an empty model file in script mode, e.g. python vre-language/scripts/run_model.py -f empty_file.vm
will produce the following error message:
Traceback (most recent call last):
File "/pfs/data5/home/kit/scc/xz1234/vre-language/src/virtmat/language/utilities/errors.py", line 94, in wrapper
return func(*args, **kwargs)
File "/home/kit/scc/xz1234/vre-language/scripts/run_model.py", line 73, in evaluate_prog
print(f'program output: >>>\n{prog.value}\n<<<')
AttributeError: 'str' object has no attribute 'value'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/kit/scc/xz1234/vre-language/scripts/run_model.py", line 96, in <module>
main()
File "/home/kit/scc/xz1234/vre-language/scripts/run_model.py", line 92, in main
evaluate_prog(clargs, prog)
File "/pfs/data5/home/kit/scc/xz1234/vre-language/src/virtmat/language/utilities/errors.py", line 99, in wrapper
raise RuntimeError('non-handled exception') from err
RuntimeError: non-handled exception
This error message will be generated when using:
- no explicit mode option (default is instant)
- instant mode
- deferred mode
If -m workflow
is specified, the model runs and prints the following output:
INFO:root:running in deferred_mode
INFO:root:running in workflow mode
INFO:root:empty model
Empty input should be accepted. In any case, if any error message occurred, it should be wrapped by the interpreter for ease of understanding and correction by users.