1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 10:19:30 +02:00

Oops. Fix stupid error in lifecycle.

This commit is contained in:
Simo Kinnunen 2014-04-04 20:16:18 +09:00
parent e0b4b3b40f
commit 941f4cb051

View file

@ -11,19 +11,21 @@ function Lifecycle() {
}
Lifecycle.prototype.share = function(name, emitter, options) {
_.defaults(options, {
var opts = _.assign({
end: true
, error: true
})
}
, options
)
if (options.end) {
if (opts.end) {
emitter.on('end', function() {
log.fatal('%s ended; we shall share its fate', name)
this.fatal()
}.bind(this))
}
if (options.error) {
if (opts.error) {
emitter.on('error', function(err) {
log.fatal('%s had an error', name, err.stack)
this.fatal()