Update XcmError on sending failure. (#358)

This commit is contained in:
Shaun Wang
2021-03-09 08:30:51 +13:00
committed by GitHub
parent 5fd6e1b4fd
commit 1eecfe1acb
+2 -3
View File
@@ -157,7 +157,7 @@ impl<T: Config> SendXcm for Module<T> {
let hash = T::Hashing::hash(&data); let hash = T::Hashing::hash(&data);
T::UpwardMessageSender::send_upward_message(data) T::UpwardMessageSender::send_upward_message(data)
.map_err(|_| XcmError::Undefined)?; .map_err(|_| XcmError::CannotReachDestination)?;
Self::deposit_event(RawEvent::UpwardMessageSent(hash)); Self::deposit_event(RawEvent::UpwardMessageSent(hash));
Ok(()) Ok(())
@@ -170,9 +170,8 @@ impl<T: Config> SendXcm for Module<T> {
recipient: (*id).into(), recipient: (*id).into(),
data, data,
}; };
// TODO: Better error here
T::HrmpMessageSender::send_hrmp_message(message) T::HrmpMessageSender::send_hrmp_message(message)
.map_err(|_| XcmError::Undefined)?; .map_err(|_| XcmError::CannotReachDestination)?;
Self::deposit_event(RawEvent::HrmpMessageSent(hash)); Self::deposit_event(RawEvent::HrmpMessageSent(hash));
Ok(()) Ok(())
} }