Skip to content

Conversation

@frankier
Copy link

Consider a dot literal:

dot"""
graph G{
a -> b
}
"""

Currently this will give an assertion exception when layout discovers the graph.handle is C_NULL. Actually Graphviz is confused that there is a -> and it's not a digraph.

This PR handles null return values from the cgraph functions immediately and converts them into Julia exceptions. Unfortunately this does not give very good error messages (the actual error message is still just printed to stderr), however it's a bit better than the current situation, which is even less since nice in Pluto.jl since stderr is currently not routed to the Notebook by default.

I made an attempt to try and capture the error message in jl_putstr and jlio_write so that it could be put onto the exception, but this did not work out. For some reason Graphviz is not routing the error messages through these callbacks.

@codecov
Copy link

codecov bot commented Feb 11, 2022

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@Keno
Copy link
Contributor

Keno commented Feb 11, 2022

Could you add a testcase for the new behavior? I think there's a separate callback (agusererrf) for capturing error messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants