tomtom-international / asciidoxy

AsciiDoxy generates API documentation from Doxygen XML output to AsciiDoc.
Apache License 2.0
31 stars 10 forks source link

Unexpected exception when handling ReferenceNotFoundError #67

Closed silvester747 closed 2 years ago

silvester747 commented 2 years ago

Some path magic is incorrect:

Traceback (most recent call last):
  File "/home/rob/git/asciidoxy/asciidoxy/cli.py", line 93, in main
    documents = process_adoc(in_doc, api_reference, pkg_mgr, config, progress=progress)
  File "/home/rob/git/asciidoxy/asciidoxy/generator/asciidoc.py", line 923, in process_adoc
    PreprocessingApi(context).process_adoc()
  File "/home/rob/git/asciidoxy/asciidoxy/generator/asciidoc.py", line 750, in process_adoc
    self.render_adoc()
  File "/home/rob/git/asciidoxy/asciidoxy/generator/asciidoc.py", line 631, in render_adoc
    return template.render(env=self._context.env,
  File "/home/rob/.virtualenvs/asciidoxy/lib/python3.10/site-packages/Mako-1.1.6-py3.10.egg/mako/template.py", line 473, in render
    return runtime._render(self, self.callable_, args, data)
  File "/home/rob/.virtualenvs/asciidoxy/lib/python3.10/site-packages/Mako-1.1.6-py3.10.egg/mako/runtime.py", line 878, in _render
    _render_context(
  File "/home/rob/.virtualenvs/asciidoxy/lib/python3.10/site-packages/Mako-1.1.6-py3.10.egg/mako/runtime.py", line 920, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/home/rob/.virtualenvs/asciidoxy/lib/python3.10/site-packages/Mako-1.1.6-py3.10.egg/mako/runtime.py", line 947, in _exec_template
    callable_(context, *args, **kwargs)
  File "/home/rob/git/asciidoxy/build/visual-test/cache/documents/home/rob/git/asciidoxy/tests/visual/cpp.adoc.py", line 31, in render_body
    __M_writer(str(insert("Logger", leveloffset="+2")))
  File "/home/rob/git/asciidoxy/asciidoxy/generator/asciidoc.py", line 138, in _wrapper
    ret = f(*args, **kwargs)
  File "/home/rob/git/asciidoxy/asciidoxy/generator/asciidoc.py", line 266, in insert
    return self.insert_fragment(self.find_element(name,
  File "/home/rob/git/asciidoxy/asciidoxy/generator/asciidoc.py", line 591, in find_element
    raise ReferenceNotFoundError(name, lang=lang, kind=kind)
asciidoxy.generator.errors.ReferenceNotFoundError: Cannot find any Logger for any

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rob/.virtualenvs/asciidoxy/bin/asciidoxy", line 33, in <module>
    sys.exit(load_entry_point('asciidoxy', 'console_scripts', 'asciidoxy')())
  File "/home/rob/git/asciidoxy/asciidoxy/cli.py", line 96, in main
    logger.error(human_traceback(pkg_mgr))
  File "/home/rob/git/asciidoxy/asciidoxy/cli.py", line 128, in human_traceback
    package_name, original_file = pkg_mgr.find_original_file(Path(filename))
  File "/home/rob/git/asciidoxy/asciidoxy/packaging/manager.py", line 226, in find_original_file
    rel_path = work_file.relative_to(self.work_dir)
  File "/usr/lib/python3.10/pathlib.py", line 816, in relative_to
    raise ValueError("{!r} is not in the subpath of {!r}"
ValueError: '/home/rob/git/asciidoxy/tests/visual/cpp.adoc' is not in the subpath of '/home/rob/git/asciidoxy/build/visual-test/intermediate' OR one path is relative and the other is absolute.
make: *** [Makefile:163: visual-test-cpp] Error 1