mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +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) {
|
||||
return Promise.try(function() {
|
||||
function Check() {
|
||||
}
|
||||
|
||||
|
@ -104,14 +103,15 @@ module.exports.handler = function() {
|
|||
}
|
||||
}
|
||||
|
||||
return Promise.try(function() {
|
||||
return fn(new Check())
|
||||
})
|
||||
.catch(CheckError, function(err) {
|
||||
log.error(err.message)
|
||||
})
|
||||
.catch(function(err) {
|
||||
log.error('Unexpected error checking %s: %s', label, err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function checkOSArch() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue