Bug 1545793 - Propogate new BITS client error through the async XPCOM layer r=lina

Differential Revision: https://phabricator.services.mozilla.com/D28257

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kirk Steuber 2019-04-22 16:21:53 +00:00
Родитель e4c75e6001
Коммит 4bc2b30f74
2 изменённых файлов: 45 добавлений и 0 удалений

Просмотреть файл

@ -88,6 +88,7 @@ interface nsIBits : nsISupports
const long ERROR_TYPE_BITS_STATE_UNEXPECTED = 46;
const long ERROR_TYPE_VERIFICATION_FAILURE = 47;
const long ERROR_TYPE_ACCESS_DENIED_EXPECTED = 48;
const long ERROR_TYPE_FAILED_TO_CONNECT_TO_BCM = 49;
/**
* nsBitsErrorAction values

Просмотреть файл

@ -60,6 +60,7 @@ pub enum ErrorType {
BitsStateTransientError,
BitsStateCancelled,
BitsStateUnexpected,
FailedToConnectToBcm,
}
impl ErrorType {
@ -116,6 +117,7 @@ impl ErrorType {
ErrorType::BitsStateTransientError => nsIBits::ERROR_TYPE_BITS_STATE_TRANSIENT_ERROR,
ErrorType::BitsStateCancelled => nsIBits::ERROR_TYPE_BITS_STATE_CANCELLED,
ErrorType::BitsStateUnexpected => nsIBits::ERROR_TYPE_BITS_STATE_UNEXPECTED,
ErrorType::FailedToConnectToBcm => nsIBits::ERROR_TYPE_FAILED_TO_CONNECT_TO_BCM,
};
val as i32
}
@ -311,6 +313,12 @@ impl From<StartJobFailure> for BitsTaskError {
error_stage,
error_code: error_code.into(),
},
StartJobFailure::ConnectBcm(error_code) => BitsTaskError {
error_type: ErrorType::FailedToConnectToBcm,
error_action,
error_stage,
error_code: error_code.into(),
},
StartJobFailure::OtherBITS(error_code) => BitsTaskError {
error_type: ErrorType::OtherBitsError,
error_action,
@ -350,6 +358,12 @@ impl From<MonitorJobFailure> for BitsTaskError {
error_stage,
error_code: error_code.into(),
},
MonitorJobFailure::ConnectBcm(error_code) => BitsTaskError {
error_type: ErrorType::FailedToConnectToBcm,
error_action,
error_stage,
error_code: error_code.into(),
},
MonitorJobFailure::OtherBITS(error_code) => BitsTaskError {
error_type: ErrorType::OtherBitsError,
error_action,
@ -389,6 +403,12 @@ impl From<SuspendJobFailure> for BitsTaskError {
error_stage,
error_code: error_code.into(),
},
SuspendJobFailure::ConnectBcm(error_code) => BitsTaskError {
error_type: ErrorType::FailedToConnectToBcm,
error_action,
error_stage,
error_code: error_code.into(),
},
SuspendJobFailure::OtherBITS(error_code) => BitsTaskError {
error_type: ErrorType::OtherBitsError,
error_action,
@ -428,6 +448,12 @@ impl From<ResumeJobFailure> for BitsTaskError {
error_stage,
error_code: error_code.into(),
},
ResumeJobFailure::ConnectBcm(error_code) => BitsTaskError {
error_type: ErrorType::FailedToConnectToBcm,
error_action,
error_stage,
error_code: error_code.into(),
},
ResumeJobFailure::OtherBITS(error_code) => BitsTaskError {
error_type: ErrorType::OtherBitsError,
error_action,
@ -467,6 +493,12 @@ impl From<SetJobPriorityFailure> for BitsTaskError {
error_stage,
error_code: error_code.into(),
},
SetJobPriorityFailure::ConnectBcm(error_code) => BitsTaskError {
error_type: ErrorType::FailedToConnectToBcm,
error_action,
error_stage,
error_code: error_code.into(),
},
SetJobPriorityFailure::OtherBITS(error_code) => BitsTaskError {
error_type: ErrorType::OtherBitsError,
error_action,
@ -539,6 +571,12 @@ impl From<CompleteJobFailure> for BitsTaskError {
error_stage,
error_code: ErrorCode::None,
},
CompleteJobFailure::ConnectBcm(error_code) => BitsTaskError {
error_type: ErrorType::FailedToConnectToBcm,
error_action,
error_stage,
error_code: error_code.into(),
},
CompleteJobFailure::OtherBITS(error_code) => BitsTaskError {
error_type: ErrorType::OtherBitsError,
error_action,
@ -578,6 +616,12 @@ impl From<CancelJobFailure> for BitsTaskError {
error_stage,
error_code: error_code.into(),
},
CancelJobFailure::ConnectBcm(error_code) => BitsTaskError {
error_type: ErrorType::FailedToConnectToBcm,
error_action,
error_stage,
error_code: error_code.into(),
},
CancelJobFailure::OtherBITS(error_code) => BitsTaskError {
error_type: ErrorType::OtherBitsError,
error_action,