Skip to content

Commit e709c9f

Browse files
authored
Error logging for send xcm to pallet-xcm (#6579)
1 parent 75e79fa commit e709c9f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

polkadot/xcm/pallet-xcm/src/lib.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,10 @@ pub mod pallet {
363363
let message: Xcm<()> = (*message).try_into().map_err(|()| Error::<T>::BadVersion)?;
364364

365365
let message_id = Self::send_xcm(interior, dest.clone(), message.clone())
366-
.map_err(Error::<T>::from)?;
366+
.map_err(|error| {
367+
tracing::error!(target: "xcm::pallet_xcm::send", ?error, ?dest, ?message, "XCM send failed with error");
368+
Error::<T>::from(error)
369+
})?;
367370
let e = Event::Sent { origin: origin_location, destination: dest, message, message_id };
368371
Self::deposit_event(e);
369372
Ok(message_id)
@@ -1800,7 +1803,10 @@ impl<T: Config> Pallet<T> {
18001803

18011804
if let Some(remote_xcm) = remote_xcm {
18021805
let (ticket, price) = validate_send::<T::XcmRouter>(dest.clone(), remote_xcm.clone())
1803-
.map_err(Error::<T>::from)?;
1806+
.map_err(|error| {
1807+
tracing::error!(target: "xcm::pallet_xcm::execute_xcm_transfer", ?error, ?dest, ?remote_xcm, "XCM validate_send failed with error");
1808+
Error::<T>::from(error)
1809+
})?;
18041810
if origin != Here.into_location() {
18051811
Self::charge_fees(origin.clone(), price.clone()).map_err(|error| {
18061812
tracing::error!(
@@ -1810,7 +1816,11 @@ impl<T: Config> Pallet<T> {
18101816
Error::<T>::FeesNotMet
18111817
})?;
18121818
}
1813-
let message_id = T::XcmRouter::deliver(ticket).map_err(Error::<T>::from)?;
1819+
let message_id = T::XcmRouter::deliver(ticket)
1820+
.map_err(|error| {
1821+
tracing::error!(target: "xcm::pallet_xcm::execute_xcm_transfer", ?error, ?dest, ?remote_xcm, "XCM deliver failed with error");
1822+
Error::<T>::from(error)
1823+
})?;
18141824

18151825
let e = Event::Sent { origin, destination: dest, message: remote_xcm, message_id };
18161826
Self::deposit_event(e);

polkadot/xcm/xcm-builder/src/process_xcm_message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl<
5858
let message = Xcm::<Call>::try_from(versioned_message).map_err(|_| {
5959
log::trace!(
6060
target: LOG_TARGET,
61-
"Failed to convert `VersionedXcm` into `XcmV3`.",
61+
"Failed to convert `VersionedXcm` into `xcm::prelude::Xcm`!",
6262
);
6363

6464
ProcessMessageError::Unsupported

0 commit comments

Comments
 (0)