Skip to content
Snippets Groups Projects
Commit 1eecfe1a authored by Shaun Wang's avatar Shaun Wang Committed by GitHub
Browse files

Update XcmError on sending failure. (#358)

parent 5fd6e1b4
No related merge requests found
......@@ -157,7 +157,7 @@ impl<T: Config> SendXcm for Module<T> {
let hash = T::Hashing::hash(&data);
T::UpwardMessageSender::send_upward_message(data)
.map_err(|_| XcmError::Undefined)?;
.map_err(|_| XcmError::CannotReachDestination)?;
Self::deposit_event(RawEvent::UpwardMessageSent(hash));
Ok(())
......@@ -170,9 +170,8 @@ impl<T: Config> SendXcm for Module<T> {
recipient: (*id).into(),
data,
};
// TODO: Better error here
T::HrmpMessageSender::send_hrmp_message(message)
.map_err(|_| XcmError::Undefined)?;
.map_err(|_| XcmError::CannotReachDestination)?;
Self::deposit_event(RawEvent::HrmpMessageSent(hash));
Ok(())
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment