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:
parent
6bf300e29d
commit
2b836f6382
1 changed files with 50 additions and 50 deletions
|
@ -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() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue