Skip to content

Commit 39405c5

Browse files
committed
track preprocessor exceptions
1 parent 93b5cb4 commit 39405c5

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

lib/preprocessor.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var Preprocessor = function( preprocessor_path, options ){
2121

2222
var server = options.server;
2323
var logger = server.logger;
24+
var raven_client = server.raven_client;
2425
var preprocessor = this;
2526
var data = this.data = '{}';
2627
this.path = preprocessor_path;
@@ -29,8 +30,15 @@ var Preprocessor = function( preprocessor_path, options ){
2930
this.process = function( context, callback ){
3031

3132
workers( context, this.path, function( err, preprocessed_context ){
32-
if( err ){
33+
// preprocessor errors don't bubble up
34+
// so log them here
35+
if( err ){
3336
logger.log( 'Preprocessor Error:\n'+ err.stack, 0 );
37+
raven_client.captureError( err, {
38+
extra: {
39+
context: context
40+
}
41+
});
3442
if( callback ) return callback( context );
3543
}
3644
if( callback ) return callback( preprocessed_context );

0 commit comments

Comments
 (0)