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

Make sure that check actually catches and handles errors, even if synchronous.

This commit is contained in:
Simo Kinnunen 2017-04-29 12:55:15 +09:00
parent 6bf300e29d
commit 2b836f6382

View file

@ -54,7 +54,6 @@ module.exports.handler = function() {
} }
function check(label, fn) { function check(label, fn) {
return Promise.try(function() {
function Check() { function Check() {
} }
@ -104,14 +103,15 @@ module.exports.handler = function() {
} }
} }
return Promise.try(function() {
return fn(new Check()) return fn(new Check())
})
.catch(CheckError, function(err) { .catch(CheckError, function(err) {
log.error(err.message) log.error(err.message)
}) })
.catch(function(err) { .catch(function(err) {
log.error('Unexpected error checking %s: %s', label, err) log.error('Unexpected error checking %s: %s', label, err)
}) })
})
} }
function checkOSArch() { function checkOSArch() {