felixge / node-ar-drone

A node.js client for controlling Parrot AR Drone 2.0 quad-copters.
http://nodecopter.com/
MIT License
1.76k stars 428 forks source link

PngStream does not catch PngEncoder errors #44

Closed eschnou closed 11 years ago

eschnou commented 11 years ago

When PngEncoder emits an error (eg. ffmpeg is not present on the host), it is not propagated to PngStream and this leads to cryptic stack-trace for end-users.

I assume just adding a handler for errors (maybe also other events) here will do the trick: https://github.com/felixge/node-ar-drone/blob/master/lib/video/PngStream.js#L41

felixge commented 11 years ago

yes, needs a handler

Sent from my iPhone

On 22.05.2013, at 10:07, Laurent Eschenauer notifications@github.com wrote:

When PngEncoder emits an error (eg. ffmpeg is not present on the host), it is not propagated to PngStream and this leads to cryptic stack-trace for end-users.

I assume just adding a handler for errors (maybe also other events) here will do the trick: https://github.com/felixge/node-ar-drone/blob/master/lib/video/PngStream.js#L41

— Reply to this email directly or view it on GitHub.

eschnou commented 11 years ago

So, it seems just adding a handler was not enough to fix my weird stacktrace on missing ffmpeg. It seems since node 0.10 that spawning a child process can emit an 'error' when the binary is not found. Addind this logic fixes my issue and now display the correct error message.

eschnou commented 11 years ago

Closing this now. Fixed by this pull-request: https://github.com/felixge/node-ar-drone/pull/45 I wonder why Github did not close it automatically.