how to detect error in plantuml server rendering

0 votes
asked Sep 12, 2017 in Wanted features by anonymous
When I render a UML diagram via PlantUML server e.g. http://www.plantuml.com/plantuml/uml and get an error - is there any way to know this?

Sure I can see the error in the rendered diagram - but this is not computer readable. Is there a programmatic way to know that there has been a PlantUML syntax error etc.  A http code or something?

1 Answer

0 votes
answered Sep 17, 2017 by plantuml (207,620 points)

This is not documented, but we have added some HTTP header in the HTTP response.

For example, if you go to http://www.plantuml.com/plantuml/png/SyfFKj2rKt3CoKnELR1Io4ZDoSddAid8B5O0eiGyXTIYelmY0000

You will have the following headers:

X-PlantUML-Diagram-Description: (Error)
X-PlantUML-Diagram-Error: Syntax Error?, Syntax Error?
X-PlantUML-Diagram-Error-Line: 2, 2

This is something you can use for your own need. Is this what you are looking for ?

commented Oct 17, 2017 by anonymous
Hello,

I've looked at the attached link, but I cannot see the headers (using inspect)

Regards,
Jon
commented Oct 19, 2017 by plantuml (207,620 points)
Note: it's in the HTTP header (see https://en.wikipedia.org/wiki/List_of_HTTP_header_fields )
not in the HTML code.
I think inspect shows the HTML code, and not the HTTP header (not sure about this)
...