mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Remove unused errors and make STF error codes match Android error codes better.
This commit is contained in:
parent
254994ce3b
commit
77261ffd43
2 changed files with 6 additions and 12 deletions
|
@ -161,14 +161,14 @@ module.exports = syrup.serial()
|
|||
.then(function() {
|
||||
push.send([
|
||||
channel
|
||||
, reply.okay('success')
|
||||
, reply.okay('INSTALL_SUCCEEDED')
|
||||
])
|
||||
})
|
||||
.catch(Promise.TimeoutError, function(err) {
|
||||
log.error('Installation of package "%s" failed', pkg, err.stack)
|
||||
push.send([
|
||||
channel
|
||||
, reply.fail('timeout')
|
||||
, reply.fail('INSTALL_ERROR_TIMEOUT')
|
||||
])
|
||||
})
|
||||
.catch(InstallationError, function(err) {
|
||||
|
@ -186,7 +186,7 @@ module.exports = syrup.serial()
|
|||
log.error('Installation of package "%s" failed', pkg, err.stack)
|
||||
push.send([
|
||||
channel
|
||||
, reply.fail('fail')
|
||||
, reply.fail('INSTALL_ERROR_UNKNOWN')
|
||||
])
|
||||
})
|
||||
})
|
||||
|
|
|
@ -6,15 +6,9 @@ var responses = require('./response-codes.json')
|
|||
module.exports = function installErrorFilter(gettext) {
|
||||
return function (text) {
|
||||
switch (text) {
|
||||
case 'fail_invalid_app_file':
|
||||
return gettext('Uploaded file is not valid.')
|
||||
case 'fail_download':
|
||||
return gettext('Failed to download specified URL.')
|
||||
case 'fail_invalid_url':
|
||||
return gettext('The specified URL is invalid.')
|
||||
case 'fail':
|
||||
return gettext('Upload failed to due unknown error.')
|
||||
case 'timeout':
|
||||
case 'INSTALL_ERROR_UNKNOWN':
|
||||
return gettext('Installation failed due to an unknown error.')
|
||||
case 'INSTALL_ERROR_TIMEOUT':
|
||||
return gettext('Installation timed out.')
|
||||
default:
|
||||
return gettext(responses[text] || text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue