aheckmann / gm

GraphicsMagick for node
http://aheckmann.github.com/gm/
6.95k stars 615 forks source link

Show error message if reading stream fails #865

Open revmischa opened 8 months ago

revmischa commented 8 months ago

It's difficult to debug some errors when the only error message is "Stream yields empty buffer".

This adds stderr to the error message to make it easier to see what's going on.

Before:

Stream yields empty buffer

After:

Error converting pdf to image Error: Stream yields empty buffer
gm convert: "gs" "-q" "-dBATCH" "-dSAFER" "-dMaxBitmap=50000000" "-dNOPAUSE" "-sDEVICE=pnmraw" "-dTextAlphaBits=4" "-dGraphicsAlphaBits=4" "-r200x200" "-sOutputFile=/tmp/gmKaF5ew" "--" "/tmp/gmh3XZfq" "-c" "quit" (child process quit due to signal 11).
gm convert: Request did not return an image.