mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 17:53:32 +02:00
Trap more errors.
This commit is contained in:
@@ -35,6 +35,12 @@ module.exports = function(options) {
|
||||
// Show serial number in logs
|
||||
logger.setGlobalIdentifier(options.serial)
|
||||
|
||||
// Panic if necessary
|
||||
Promise.onPossiblyUnhandledRejection(function(err, promise) {
|
||||
log.fatal('Unhandled rejection', err.stack)
|
||||
selfDestruct()
|
||||
})
|
||||
|
||||
// Adb
|
||||
var adb = Promise.promisifyAll(adbkit.createClient())
|
||||
|
||||
@@ -210,10 +216,14 @@ module.exports = function(options) {
|
||||
})
|
||||
})
|
||||
})
|
||||
.done(function() {
|
||||
.then(function() {
|
||||
log.info('Ready for instructions')
|
||||
poke()
|
||||
})
|
||||
.catch(function(err) {
|
||||
log.fatal('Setup failed', err.stack)
|
||||
selfDestruct()
|
||||
})
|
||||
|
||||
sub.on('message', function(channel, data) {
|
||||
var wrapper = wire.Envelope.decode(data)
|
||||
|
||||
Reference in New Issue
Block a user