Bug 848688 - Have a consistent naming for error message. r=allstars.chh

This commit is contained in:
Edgar Chen 2013-03-07 18:35:57 +08:00
parent 3a517af32a
commit 79d40c9fc8
3 changed files with 24 additions and 24 deletions

View File

@ -1003,7 +1003,7 @@ RILContentHelper.prototype = {
case "RIL:CallError":
this._deliverEvent("_telephonyListeners",
"notifyError",
[msg.json.callIndex, msg.json.error]);
[msg.json.callIndex, msg.json.errorMsg]);
break;
case "RIL:VoicemailNotification":
this.handleVoicemailNotification(msg.json);
@ -1062,7 +1062,7 @@ RILContentHelper.prototype = {
case "RIL:DataError":
this.updateConnectionInfo(msg.json, this.rilContext.dataConnectionInfo);
this._deliverEvent("_mobileConnectionListeners", "notifyDataError",
[msg.json.error]);
[msg.json.errorMsg]);
break;
case "RIL:GetCallForwardingOption":
this.handleGetCallForwardingOption(msg.json);
@ -1117,9 +1117,9 @@ RILContentHelper.prototype = {
return;
}
if (message.error) {
debug("Received error from getAvailableNetworks: " + message.error);
Services.DOMRequest.fireError(request, message.error);
if (message.errorMsg) {
debug("Received error from getAvailableNetworks: " + message.errorMsg);
Services.DOMRequest.fireError(request, message.errorMsg);
return;
}
@ -1138,32 +1138,32 @@ RILContentHelper.prototype = {
this._selectingNetwork = null;
this.networkSelectionMode = mode;
if (message.error) {
this.fireRequestError(message.requestId, message.error);
if (message.errorMsg) {
this.fireRequestError(message.requestId, message.errorMsg);
} else {
this.fireRequestSuccess(message.requestId, null);
}
},
handleIccOpenChannel: function handleIccOpenChannel(message) {
if (message.error) {
this.fireRequestError(message.requestId, message.error);
if (message.errorMsg) {
this.fireRequestError(message.requestId, message.errorMsg);
} else {
this.fireRequestSuccess(message.requestId, message.channel);
}
},
handleIccCloseChannel: function handleIccCloseChannel(message) {
if (message.error) {
this.fireRequestError(message.requestId, message.error);
if (message.errorMsg) {
this.fireRequestError(message.requestId, message.errorMsg);
} else {
this.fireRequestSuccess(message.requestId, null);
}
},
handleIccExchangeAPDU: function handleIccExchangeAPDU(message) {
if (message.error) {
this.fireRequestError(message.requestId, message.error);
if (message.errorMsg) {
this.fireRequestError(message.requestId, message.errorMsg);
} else {
var result = [message.sw1, message.sw2, message.simResponse];
this.fireRequestSuccess(message.requestId, result);

View File

@ -1674,7 +1674,7 @@ RadioInterfaceLayer.prototype = {
delete this._sentSmsEnvelopes[message.envelopeId];
let error = Ci.nsISmsRequest.UNKNOWN_ERROR;
switch (message.error) {
switch (message.errorMsg) {
case RIL.ERROR_RADIO_NOT_AVAILABLE:
error = Ci.nsISmsRequest.NO_SIGNAL_ERROR;
break;
@ -2063,7 +2063,7 @@ RadioInterfaceLayer.prototype = {
if (!PhoneNumberUtils.isViablePhoneNumber(number)) {
this.handleCallError({
callIndex: -1,
error: RIL.RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[RIL.CALL_FAIL_UNOBTAINABLE_NUMBER]
errorMsg: RIL.RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[RIL.CALL_FAIL_UNOBTAINABLE_NUMBER]
});
debug("Number '" + number + "' doesn't seem to be a viable number. Drop.");
return;

View File

@ -1611,7 +1611,7 @@ let RIL = {
// Notify error in establishing the call with an invalid number.
options.callIndex = -1;
options.rilMessageType = "callError";
options.error =
options.errorMsg =
RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[CALL_FAIL_UNOBTAINABLE_NUMBER];
this.sendDOMMessage(options);
return;
@ -3227,9 +3227,9 @@ let RIL = {
_sendDataCallError: function _sendDataCallError(message, errorCode) {
message.rilMessageType = "datacallerror";
if (errorCode == ERROR_GENERIC_FAILURE) {
message.error = RIL_ERROR_TO_GECKO_ERROR[errorCode];
message.errorMsg = RIL_ERROR_TO_GECKO_ERROR[errorCode];
} else {
message.error = RIL_DATACALL_FAILCAUSE_TO_GECKO_DATACALL_ERROR[errorCode];
message.errorMsg = RIL_DATACALL_FAILCAUSE_TO_GECKO_DATACALL_ERROR[errorCode];
}
this.sendDOMMessage(message);
},
@ -3832,7 +3832,7 @@ let RIL = {
this.sendDOMMessage({
rilMessageType: "sms-send-failed",
envelopeId: options.envelopeId,
error: options.rilRequestError,
errorMsg: options.rilRequestError,
});
break;
}
@ -4444,7 +4444,7 @@ RIL[REQUEST_LAST_CALL_FAIL_CAUSE] = function REQUEST_LAST_CALL_FAIL_CAUSE(length
break;
default:
options.rilMessageType = "callError";
options.error = RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[failCause];
options.errorMsg = RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[failCause];
this.sendDOMMessage(options);
break;
}
@ -4730,7 +4730,7 @@ RIL[REQUEST_SET_FACILITY_LOCK] = function REQUEST_SET_FACILITY_LOCK(length, opti
RIL[REQUEST_CHANGE_BARRING_PASSWORD] = null;
RIL[REQUEST_SIM_OPEN_CHANNEL] = function REQUEST_SIM_OPEN_CHANNEL(length, options) {
if (options.rilRequestError) {
options.error = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
return;
}
@ -4796,7 +4796,7 @@ RIL[REQUEST_QUERY_NETWORK_SELECTION_MODE] = function REQUEST_QUERY_NETWORK_SELEC
};
RIL[REQUEST_SET_NETWORK_SELECTION_AUTOMATIC] = function REQUEST_SET_NETWORK_SELECTION_AUTOMATIC(length, options) {
if (options.rilRequestError) {
options.error = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
return;
}
@ -4805,7 +4805,7 @@ RIL[REQUEST_SET_NETWORK_SELECTION_AUTOMATIC] = function REQUEST_SET_NETWORK_SELE
};
RIL[REQUEST_SET_NETWORK_SELECTION_MANUAL] = function REQUEST_SET_NETWORK_SELECTION_MANUAL(length, options) {
if (options.rilRequestError) {
options.error = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
return;
}
@ -4814,7 +4814,7 @@ RIL[REQUEST_SET_NETWORK_SELECTION_MANUAL] = function REQUEST_SET_NETWORK_SELECTI
};
RIL[REQUEST_QUERY_AVAILABLE_NETWORKS] = function REQUEST_QUERY_AVAILABLE_NETWORKS(length, options) {
if (options.rilRequestError) {
options.error = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
return;
}