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

If device gets unplugged after a service fails (happens easily because the socket dies), don't log a provider error.

This commit is contained in:
Simo Kinnunen 2014-02-04 16:07:56 +09:00
parent adaf3da228
commit 3e7d91cb91

View file

@ -166,6 +166,11 @@ module.exports = function(options) {
worker = workers[device.id] = null
})
.catch(procutil.ExitError, function(err) {
log.error(
'Device worker "%s" died with code %s'
, device.id
, err.code
)
log.info('Restarting device worker "%s"', device.id)
return Promise.delay(500)
.then(function() {
@ -203,11 +208,6 @@ module.exports = function(options) {
resolver.resolve()
}
else {
log.error(
'Device worker "%s" died with code %s'
, device.id
, code
)
resolver.reject(new procutil.ExitError(code))
}
}