From 60e455b36db1aa139e71c094832de84861be4748 Mon Sep 17 00:00:00 2001 From: hacksalot Date: Thu, 7 Jan 2016 10:54:27 -0500 Subject: [PATCH] Emit call stack for wkhtmltopdf errors. --- src/core/error-handler.js | 1 + src/gen/html-pdf-generator.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/error-handler.js b/src/core/error-handler.js index bab6054..dadfae8 100644 --- a/src/core/error-handler.js +++ b/src/core/error-handler.js @@ -88,6 +88,7 @@ Error-handling routines for HackMyResume. case HACKMYSTATUS.wkhtmltopdf: msg = chalk.red.bold('ERROR: PDF generation failed. ') + chalk.red('Make sure wkhtmltopdf is ' + 'installed and accessible from your path.'); + if( ex.inner ) msg += chalk.red('\n' + ex.inner); break; case HACKMYSTATUS.invalid: diff --git a/src/gen/html-pdf-generator.js b/src/gen/html-pdf-generator.js index 5eb931d..1b7fa93 100644 --- a/src/gen/html-pdf-generator.js +++ b/src/gen/html-pdf-generator.js @@ -45,7 +45,7 @@ Definition of the HtmlPdfGenerator class. catch(ex) { // { [Error: write EPIPE] code: 'EPIPE', errno: 'EPIPE', ... } // { [Error: ENOENT] } - throw { fluenterror: this.codes.wkhtmltopdf }; + throw { fluenterror: this.codes.wkhtmltopdf, inner: ex }; } },