From 1eecfe1acb09aa39fc1bed335b3d9ab255d6e68e Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Tue, 9 Mar 2021 08:30:51 +1300 Subject: [PATCH] Update XcmError on sending failure. (#358) --- cumulus/pallets/xcm-handler/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cumulus/pallets/xcm-handler/src/lib.rs b/cumulus/pallets/xcm-handler/src/lib.rs index 13b1361d9d..1f80eee780 100644 --- a/cumulus/pallets/xcm-handler/src/lib.rs +++ b/cumulus/pallets/xcm-handler/src/lib.rs @@ -157,7 +157,7 @@ impl SendXcm for Module { 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 SendXcm for Module { 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(()) }