mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-21 13:25:17 +02:00
Refactor installation to work out a few bugs and to make it cleaner. Transactions now reject on fail-responses, still need to update other places.
This commit is contained in:
@@ -5,6 +5,19 @@ var responses = require('./response-codes.json')
|
||||
|
||||
module.exports = function installErrorFilter(gettext) {
|
||||
return function (text) {
|
||||
return gettext(responses[text] || 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':
|
||||
return gettext('Installation timed out.')
|
||||
default:
|
||||
return gettext(responses[text] || text)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user