Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rinoh crashes with an unhandled exception when the template is not found #291

Closed
haferburg opened this issue Sep 14, 2021 · 1 comment
Closed
Labels
bug crash rinohtype aborts due to an uncaught exception rinoh Command line tool

Comments

@haferburg
Copy link

run("rinoh -s stylesheet.rts -t template_config.rtt -O output output/report_de.rst")

Traceback (most recent call last):
  File "c:\users\ahaferbu\.pyenv\pyenv-win\versions\3.9.6\lib\site-packages\rinoh\resource.py", line 40, in parse_string
    entry_point, dist = next(entry_points)
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\ahaferbu\.pyenv\pyenv-win\versions\3.9.6\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\ahaferbu\.pyenv\pyenv-win\versions\3.9.6\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\AHaferbu\.pyenv\pyenv-win\versions\3.9.6\Scripts\rinoh.exe\__main__.py", line 7, in <module>
  File "c:\users\ahaferbu\.pyenv\pyenv-win\versions\3.9.6\lib\site-packages\rinoh\__main__.py", line 281, in main
    template_cls = DocumentTemplate.from_string(args.template)
  File "c:\users\ahaferbu\.pyenv\pyenv-win\versions\3.9.6\lib\site-packages\rinoh\attribute.py", line 44, in from_string
Using the reStructuredText frontend [built-in]
    return cls.parse_string(string, source)
  File "c:\users\ahaferbu\.pyenv\pyenv-win\versions\3.9.6\lib\site-packages\rinoh\resource.py", line 42, in parse_string
    raise ResourceNotFound(cls, resource_name, entry_point_name)
rinoh.resource.ResourceNotFound: (<class 'rinoh.template.DocumentTemplate'>, 'template_config.rtt', 'template_config.rtt')
$ rinoh --version
rinoh 0.5.3 (2021-06-16)
@haferburg haferburg added bug crash rinohtype aborts due to an uncaught exception labels Sep 14, 2021
@brechtm brechtm added the rinoh Command line tool label Oct 1, 2021
@brechtm
Copy link
Owner

brechtm commented Oct 1, 2021

👍 rinoh should exit with an instructive error message instead.

@brechtm brechtm closed this as completed in cc223a3 Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug crash rinohtype aborts due to an uncaught exception rinoh Command line tool
Projects
None yet
Development

No branches or pull requests

2 participants