question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I trap errors in the DOT?

See original GitHub issue

How do I trap errors in the DOT; that is, the data that I pass to d3.select("#graph").graphviz().renderDot(data, myRenderDOTEndFunction)?

I’ve read the the following in the viz.js readme:

If Graphviz encounters an error, Viz will throw an Error object with the error message.

and I’ve looked at the d3-graphviz code that calls Viz, but I can’t yet figure out how to trap errors in the input DOT that I pass to d3-graphviz.

I see that the Graphviz object returned by d3.select("#graph").graphviz().renderDot(data, myRenderDOTEndFunction) contains a _worker property, and _worker contains an onerror property that has the value null. I suspect I need to set that property.

I could burn time trying to figure out what to do next—I’m enjoying improving my JavaScript coding skills—but I need to crack on with other work.

P.S. I really like d3-graphviz. Thank you so much for this. I’m using d3-graphviz for what is, so far, a small internal-use-only project, but I hope to get management approval to publish my project as a GitHub repo, which will, effectively, be a showcase for d3-graphviz.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
GrahamHanningtoncommented, Jan 3, 2018

.onerror() (in v1.3.0) works for me, thank you! (And thank you for the new release.)

0reactions
magjaccommented, Jan 4, 2018

Thanks @GrahamHannington. I’ve updated the README.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trapping dot (.) file not found errors in KSH
You can use the command command to remove the special behavior (whereby failure causes the shell to exit among other things) of special ......
Read more >
Handle errors in ASP.NET Core | Microsoft Learn
This article covers common approaches to handling errors in ASP.NET Core web apps. See Handle errors in ASP.NET Core web APIs for web...
Read more >
Formula Checking: Don't Catch Errors that Cannot Happen
When checking whether a formula has errors, only throw Unexpected dot operator error if that line can be logically reached.
Read more >
Elegant handling a dot-source failure in Powershell
I have tried to use a Try { } Catch { } which caught the error but that imported the script into the...
Read more >
Error Handling in Large .NET Projects - Best Practices
Hiding errors silently is only appropriate in very specific scenarios, for example to catch exceptions thrown when attempting to log an error in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found