Getting proper debug info when external program fails


I ran into a nasty problem the other day that wasted more time than necessary. If I had been able to get some information that I was missing a shared library in the server log, I would have solved it in five minutes.

What needs to be enhanced so the error message is useful? Meteor? html-pdf? Something else? I’m just not sure where to start.

The answer is probably to dig into html-pdf, since that is apparently what fires off the phantomjs binary.

Thoughts? Suggestions?


The environement cannot know which package it needs. It will have an idea about a list of possible libraries that the app is seeking for and then you will need to figure out which one that exactly is and in which os package you’ll find that.

So the better way around is to get the requiring app to properly test the existence of external dependencies and gracefully stop, logging out a meaningful message, preferably os specific.

In your case, you should be digging into the html-pdf codebase as you suggested.


@serkandurusoy cool, thanks. html-pdf is probably just running phantomjs externally and swallowing/discarding anything written to standard error (or else I would have seen the error about the missing shared library).


Yep, probably.

I also don’t get why it is bundling its own phantomjs rather then listing that as a requirement. After all, html-pdf is not an end user app and it is rather better for the dev to ensure/manage such bulk dependencies.