python-plantuml icon indicating copy to clipboard operation
python-plantuml copied to clipboard

Inaccurate error message if /svgl/ or /png/ is left out from URL

Open chbndrhnns opened this issue 5 years ago • 2 comments

Creating a diagram on a custom server fails if you are missing the exact URL (see below).

I suggest appending a trailing slash (and maybe the trailing /uml) if it is missing from the server configuration.

python -m plantuml -s https://server/  a.puml

The error is:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.7/site-packages/plantuml.py", line 230, in <module>
    main()
  File "/usr/local/lib/python3.7/site-packages/plantuml.py", line 226, in main
    'gen_success': pl.processes_file(filename, directory=args.out)}, args.files)))
  File "/usr/local/lib/python3.7/site-packages/plantuml.py", line 226, in <lambda>
    'gen_success': pl.processes_file(filename, directory=args.out)}, args.files)))
  File "/usr/local/lib/python3.7/site-packages/plantuml.py", line 199, in processes_file
    content = self.processes(data)
  File "/usr/local/lib/python3.7/site-packages/plantuml.py", line 173, in processes
    raise PlantUMLHTTPError(response, content)
  File "/usr/local/lib/python3.7/site-packages/plantuml.py", line 56, in __init__
    if not self.message:
AttributeError: 'PlantUMLHTTPError' object has no attribute 'message'

chbndrhnns avatar Dec 23 '19 08:12 chbndrhnns

I'm not sure why the title was changed to remove the /uml/ because I'm still having this issue with https://github.com/mikitex70/plantuml-markdown version 3.2.2 (latest) if I omit /uml/ in the URL.

laurent-indermuehle avatar Mar 30 '20 08:03 laurent-indermuehle

Nevermind, for me, the error comes from a rectangle name in PlantUML with a dash in it. Maybe we could improve errors handling.

laurent-indermuehle avatar Mar 30 '20 11:03 laurent-indermuehle