trim output when error occurs

This commit is contained in:
Brian Gough 2015-03-12 11:12:46 +00:00
parent 3bbd0d49a9
commit 00153e61ad

View file

@ -17,12 +17,12 @@ class ASpellWorker
metrics.inc "aspellWorker-exit-" + @language
@pipe.on 'error', (err) =>
@state = 'error' unless @state == 'killed'
logger.log process: @pipe.pid, error: err, stdout: output, stderr: error, lang: @language, "aspell worker error"
logger.log process: @pipe.pid, error: err, stdout: output.slice(-1024), stderr: error.slice(-1024), lang: @language, "aspell worker error"
if @callback?
@callback err, []
@pipe.stdin.on 'error', (err) =>
@state = 'error' unless @state == 'killed'
logger.log process: @pipe.pid, error: err, stdout: output, stderr: error, lang: @language, "aspell worker error on stdin"
logger.log process: @pipe.pid, error: err, stdout: output.slice(-1024), stderr: error.slice(-1024), lang: @language, "aspell worker error on stdin"
if @callback?
@callback err, []