mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Move install response codes to the filter.
This commit is contained in:
parent
59f1aebc87
commit
fdfcdf913d
3 changed files with 4 additions and 9 deletions
|
@ -10,7 +10,6 @@ var logger = require('../../../util/logger')
|
||||||
var wire = require('../../../wire')
|
var wire = require('../../../wire')
|
||||||
var wireutil = require('../../../wire/util')
|
var wireutil = require('../../../wire/util')
|
||||||
var promiseutil = require('../../../util/promiseutil')
|
var promiseutil = require('../../../util/promiseutil')
|
||||||
var responseCodes = require('./install/response-codes')
|
|
||||||
|
|
||||||
// The error codes are available at https://github.com/android/
|
// The error codes are available at https://github.com/android/
|
||||||
// platform_frameworks_base/blob/master/core/java/android/content/
|
// platform_frameworks_base/blob/master/core/java/android/content/
|
||||||
|
@ -180,9 +179,7 @@ module.exports = syrup.serial()
|
||||||
)
|
)
|
||||||
push.send([
|
push.send([
|
||||||
channel
|
channel
|
||||||
, reply.fail(err.code, {
|
, reply.fail(err.code)
|
||||||
description: responseCodes[err.code] || null
|
|
||||||
})
|
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
.catch(function(err) {
|
.catch(function(err) {
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
// From here: https://github.com/android/platform_frameworks_base/blob/
|
// From here: https://github.com/android/platform_frameworks_base/blob/
|
||||||
// master/core/java/android/content/pm/PackageManager.java#L371
|
// master/core/java/android/content/pm/PackageManager.java#L371
|
||||||
|
|
||||||
|
var responses = require('./response-codes.json')
|
||||||
|
|
||||||
module.exports = function installErrorFilter(gettext) {
|
module.exports = function installErrorFilter(gettext) {
|
||||||
return function (text) {
|
return function (text) {
|
||||||
return {
|
return gettext(responses[text] || text)
|
||||||
INSTALL_FAILED_OLDER_SDK: gettext('New package failed because the ' +
|
|
||||||
'current SDK version is older than that required by the package')
|
|
||||||
// TODO: do the rest
|
|
||||||
}[text] || text
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue