Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
81
gaia/apps/sms/views/shared/js/errors.js
Executable file
81
gaia/apps/sms/views/shared/js/errors.js
Executable file
|
|
@ -0,0 +1,81 @@
|
|||
/* exported Errors */
|
||||
|
||||
(function(exports) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Maps error code to error description object:
|
||||
* prefix: used as prefix for error message text/title l10nId,
|
||||
* showRecipient: indicates whether recipients info should be included into
|
||||
* error message displayed to the user;
|
||||
* showDsdsStatus: indicates whether DSDS status should be included into
|
||||
* error message displayed to the user;
|
||||
* executeHandler: indicates whether confirmation handler passed to the
|
||||
* error dialog should be executed once user selects confirm action.
|
||||
* @type {Map.<string, Object>}
|
||||
*/
|
||||
const ERRORS = new Map();
|
||||
|
||||
function initErrorsMap() {
|
||||
ERRORS.set('NoSimCardError', {
|
||||
prefix: 'sendMissingSimCard'
|
||||
});
|
||||
|
||||
ERRORS.set('RadioDisabledError', {
|
||||
prefix: 'sendFlightMode'
|
||||
});
|
||||
|
||||
ERRORS.set('FdnCheckError',{
|
||||
prefix: 'fdnError',
|
||||
showRecipient: true
|
||||
});
|
||||
|
||||
ERRORS.set('NonActiveSimCardError', {
|
||||
prefix: 'switchSimToRetrieve',
|
||||
showDsdsStatus: true,
|
||||
executeHandler: true
|
||||
});
|
||||
|
||||
ERRORS.set('NoSignalError', {
|
||||
prefix: 'sendNoSignalError'
|
||||
});
|
||||
|
||||
ERRORS.set('NotFoundError', {
|
||||
prefix: 'sendNotFoundError'
|
||||
});
|
||||
|
||||
ERRORS.set('InvalidAddressError', {
|
||||
prefix: 'sendInvalidAddressError'
|
||||
});
|
||||
|
||||
ERRORS.set('SimNotMatchedError', {
|
||||
prefix: 'simNotMatchedError'
|
||||
});
|
||||
|
||||
ERRORS.set('NonActiveSimCardToSendError', {
|
||||
prefix: 'switchSimToSend',
|
||||
showDsdsStatus: true,
|
||||
executeHandler: true
|
||||
});
|
||||
|
||||
ERRORS.set('RadioDisabledToDownloadError', {
|
||||
prefix: 'radioDisabledToDownload'
|
||||
});
|
||||
|
||||
// The error type below will be represented as "GeneralError" in dialog for
|
||||
// the rest of error codes (InternalError and etc.)
|
||||
ERRORS.set('UnknownError', {
|
||||
prefix: 'sendDefaultError'
|
||||
});
|
||||
}
|
||||
|
||||
exports.Errors = {
|
||||
get: function(errorCode) {
|
||||
if (!ERRORS.size) {
|
||||
initErrorsMap();
|
||||
}
|
||||
|
||||
return ERRORS.get(errorCode) || ERRORS.get('UnknownError');
|
||||
}
|
||||
};
|
||||
})(window);
|
||||
Loading…
Reference in a new issue