1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-10 07:47:07 +01:00

Start moving logging out of core.

This commit is contained in:
hacksalot
2016-01-09 13:58:47 -05:00
parent d77b484e55
commit 732bc9809a
8 changed files with 263 additions and 91 deletions

View File

@ -40,19 +40,17 @@ Definition of the HtmlPdfCLIGenerator class.
try {
var safe_eng = info.opts.pdf || 'wkhtmltopdf';
engines[ safe_eng ].call( this, info.mk, info.outputFile );
if( safe_eng !== 'none' )
engines[ safe_eng ].call( this, info.mk, info.outputFile );
return null; // halt further processing
}
catch(ex) {
// { [Error: write EPIPE] code: 'EPIPE', errno: 'EPIPE', ... }
// { [Error: ENOENT] }
throw ( ex.inner && ex.inner.code === 'ENOENT' ) ?
{ fluenterror: this.codes.notOnPath, inner: ex.inner, engine: ex.cmd,
stack: ex.inner && ex.inner.stack } :
{ fluenterror: this.codes.pdfGeneration, inner: ex.inner,
stack: ex.inner && ex.inner.stack };
{ fluenterror: this.codes.pdfGeneration, inner: ex, stack: ex.stack };
}
}

View File

@ -169,6 +169,7 @@ Definition of the TemplateGenerator class. TODO: Refactor
{ outputFile: fileName, mk: file.data, opts: that.opts } );
}
catch(ex) {
console.log(ex);
require('../core/error-handler').err(ex, false);
}
}
@ -179,6 +180,7 @@ Definition of the TemplateGenerator class. TODO: Refactor
FS.copySync( file.info.path, thisFilePath );
}
catch(ex) {
console.log('B');
ex.showStack = true;
require('../core/error-handler').err( ex );
}