asciidoctor / asciidoctor-vscode

AsciiDoc support for Visual Studio Code using Asciidoctor
Other
323 stars 97 forks source link

No error message is shown when kroki diagram fails to render #423

Closed chtenb closed 2 years ago

chtenb commented 2 years ago

When a diagram fails to render (e.g. due to a syntax error) the user gets no feedback about what went wrong: image

It can be quite time consuming to constantly run the code in the online kroki tool to get a hold of the error message. It would be better to display a box with the error message in it as opposed to what is shown above.

ggrossetie commented 2 years ago

I assume that you are not using the kroki-fetch-diagram option to download the images from Kroki at build time?

In this case, the Asciidoctor Kroki extension will generate <img> elements that will be rendered client-side by the browser (i.e., preview pane). For instance:

<img src="https://kroki.io/graphviz/svg/abc">

When the request is unsuccessful or when an image cannot be display, the browser will show this broken image icon.

For reference, PlantUML generates images with the actual error message (as an image) but other diagram libraries don't.

When using kroki-fetch-diagram option we could display a literal block with the error message returned by the API instead of the image because the extension does fetch the image.

Anyway, this issue is not really related to VS code. Could you please move this issue to https://github.com/mogztter/asciidoctor-kroki ?

danyill commented 2 years ago

Closing as no response and not particularly relevant to this extension.

ggrossetie commented 2 years ago

This pull request https://github.com/yuzutech/kroki/pull/956 should improve the situation:

image

Having said that, I agree with @danyill, this issue is not tied to this extension.