From 7e5ce901fdf243f28938b34397d55221f44bd071 Mon Sep 17 00:00:00 2001 From: notoriaga Date: Fri, 9 Dec 2022 12:03:58 -0800 Subject: [PATCH] rust: include original message in TryFrom Error --- .../resources/rust/sbp_messages_mod.rs | 2 +- .../resources/rust/sbp_messages_template.rs | 2 +- rust/sbp/src/messages/acquisition.rs | 12 +-- rust/sbp/src/messages/bootload.rs | 12 +-- rust/sbp/src/messages/ext_events.rs | 2 +- rust/sbp/src/messages/file_io.rs | 18 ++-- rust/sbp/src/messages/flash.rs | 20 ++--- rust/sbp/src/messages/imu.rs | 4 +- rust/sbp/src/messages/integrity.rs | 12 +-- rust/sbp/src/messages/linux.rs | 22 ++--- rust/sbp/src/messages/logging.rs | 6 +- rust/sbp/src/messages/mag.rs | 2 +- rust/sbp/src/messages/mod.rs | 2 +- rust/sbp/src/messages/navigation.rs | 82 +++++++++---------- rust/sbp/src/messages/ndb.rs | 2 +- rust/sbp/src/messages/observation.rs | 76 ++++++++--------- rust/sbp/src/messages/orientation.rs | 8 +- rust/sbp/src/messages/piksi.rs | 50 +++++------ rust/sbp/src/messages/sbas.rs | 2 +- rust/sbp/src/messages/settings.rs | 20 ++--- rust/sbp/src/messages/signing.rs | 6 +- rust/sbp/src/messages/solution_meta.rs | 4 +- rust/sbp/src/messages/ssr.rs | 36 ++++---- rust/sbp/src/messages/system.rs | 26 +++--- rust/sbp/src/messages/tracking.rs | 18 ++-- rust/sbp/src/messages/user.rs | 2 +- rust/sbp/src/messages/vehicle.rs | 4 +- 27 files changed, 226 insertions(+), 226 deletions(-) diff --git a/generator/sbpg/targets/resources/rust/sbp_messages_mod.rs b/generator/sbpg/targets/resources/rust/sbp_messages_mod.rs index 9690ea2c92..1f4d49ecb7 100644 --- a/generator/sbpg/targets/resources/rust/sbp_messages_mod.rs +++ b/generator/sbpg/targets/resources/rust/sbp_messages_mod.rs @@ -98,7 +98,7 @@ pub trait ConcreteMessage: SbpMessage + TryFrom { /// The error returned when using [TryFrom] to convert [Sbp] to the wrong message type. #[derive(Debug, Clone)] -pub struct TryFromSbpError; +pub struct TryFromSbpError(pub Sbp); impl std::fmt::Display for TryFromSbpError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/generator/sbpg/targets/resources/rust/sbp_messages_template.rs b/generator/sbpg/targets/resources/rust/sbp_messages_template.rs index 26cb13a4f3..7524679e7d 100644 --- a/generator/sbpg/targets/resources/rust/sbp_messages_template.rs +++ b/generator/sbpg/targets/resources/rust/sbp_messages_template.rs @@ -145,7 +145,7 @@ impl TryFrom for (((m.msg_name))) { fn try_from(msg: Sbp) -> Result { match msg { Sbp::(((m.msg_name)))(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/acquisition.rs b/rust/sbp/src/messages/acquisition.rs index c00920b628..d8b267452c 100644 --- a/rust/sbp/src/messages/acquisition.rs +++ b/rust/sbp/src/messages/acquisition.rs @@ -313,7 +313,7 @@ pub mod msg_acq_result { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgAcqResult(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -409,7 +409,7 @@ pub mod msg_acq_result_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgAcqResultDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -504,7 +504,7 @@ pub mod msg_acq_result_dep_b { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgAcqResultDepB(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -598,7 +598,7 @@ pub mod msg_acq_result_dep_c { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgAcqResultDepC(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -684,7 +684,7 @@ pub mod msg_acq_sv_profile { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgAcqSvProfile(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -757,7 +757,7 @@ pub mod msg_acq_sv_profile_dep { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgAcqSvProfileDep(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/bootload.rs b/rust/sbp/src/messages/bootload.rs index 61e105280c..e7cc99cc59 100644 --- a/rust/sbp/src/messages/bootload.rs +++ b/rust/sbp/src/messages/bootload.rs @@ -74,7 +74,7 @@ pub mod msg_bootloader_handshake_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgBootloaderHandshakeDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -145,7 +145,7 @@ pub mod msg_bootloader_handshake_req { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgBootloaderHandshakeReq(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -260,7 +260,7 @@ pub mod msg_bootloader_handshake_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgBootloaderHandshakeResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -335,7 +335,7 @@ pub mod msg_bootloader_jump_to_app { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgBootloaderJumpToApp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -409,7 +409,7 @@ pub mod msg_nap_device_dna_req { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgNapDeviceDnaReq(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -481,7 +481,7 @@ pub mod msg_nap_device_dna_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgNapDeviceDnaResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/ext_events.rs b/rust/sbp/src/messages/ext_events.rs index 34e0ca7009..5ca9a4b57b 100644 --- a/rust/sbp/src/messages/ext_events.rs +++ b/rust/sbp/src/messages/ext_events.rs @@ -124,7 +124,7 @@ pub mod msg_ext_event { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgExtEvent(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/file_io.rs b/rust/sbp/src/messages/file_io.rs index 204697a7ac..ade4c2f1ce 100644 --- a/rust/sbp/src/messages/file_io.rs +++ b/rust/sbp/src/messages/file_io.rs @@ -83,7 +83,7 @@ pub mod msg_fileio_config_req { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFileioConfigReq(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -168,7 +168,7 @@ pub mod msg_fileio_config_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFileioConfigResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -266,7 +266,7 @@ pub mod msg_fileio_read_dir_req { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFileioReadDirReq(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -353,7 +353,7 @@ pub mod msg_fileio_read_dir_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFileioReadDirResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -442,7 +442,7 @@ pub mod msg_fileio_read_req { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFileioReadReq(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -532,7 +532,7 @@ pub mod msg_fileio_read_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFileioReadResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -609,7 +609,7 @@ pub mod msg_fileio_remove { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFileioRemove(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -696,7 +696,7 @@ pub mod msg_fileio_write_req { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFileioWriteReq(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -783,7 +783,7 @@ pub mod msg_fileio_write_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFileioWriteResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/flash.rs b/rust/sbp/src/messages/flash.rs index c5137b8fd3..71ff6732b4 100644 --- a/rust/sbp/src/messages/flash.rs +++ b/rust/sbp/src/messages/flash.rs @@ -96,7 +96,7 @@ pub mod msg_flash_done { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFlashDone(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -240,7 +240,7 @@ pub mod msg_flash_erase { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFlashErase(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -373,7 +373,7 @@ pub mod msg_flash_program { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFlashProgram(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -514,7 +514,7 @@ pub mod msg_flash_read_req { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFlashReadReq(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -651,7 +651,7 @@ pub mod msg_flash_read_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFlashReadResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -762,7 +762,7 @@ pub mod msg_m25_flash_write_status { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgM25FlashWriteStatus(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -835,7 +835,7 @@ pub mod msg_stm_flash_lock_sector { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgStmFlashLockSector(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -908,7 +908,7 @@ pub mod msg_stm_flash_unlock_sector { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgStmFlashUnlockSector(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -980,7 +980,7 @@ pub mod msg_stm_unique_id_req { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgStmUniqueIdReq(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1050,7 +1050,7 @@ pub mod msg_stm_unique_id_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgStmUniqueIdResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/imu.rs b/rust/sbp/src/messages/imu.rs index 2890e58aab..e2ba6b63e8 100644 --- a/rust/sbp/src/messages/imu.rs +++ b/rust/sbp/src/messages/imu.rs @@ -118,7 +118,7 @@ pub mod msg_imu_aux { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgImuAux(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -394,7 +394,7 @@ pub mod msg_imu_raw { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgImuRaw(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/integrity.rs b/rust/sbp/src/messages/integrity.rs index 4b68795a8c..8e318609e6 100644 --- a/rust/sbp/src/messages/integrity.rs +++ b/rust/sbp/src/messages/integrity.rs @@ -345,7 +345,7 @@ pub mod msg_ssr_flag_high_level { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrFlagHighLevel(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -752,7 +752,7 @@ pub mod msg_ssr_flag_iono_grid_points { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrFlagIonoGridPoints(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -838,7 +838,7 @@ pub mod msg_ssr_flag_iono_grid_point_sat_los { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrFlagIonoGridPointSatLos(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -925,7 +925,7 @@ pub mod msg_ssr_flag_iono_tile_sat_los { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrFlagIonoTileSatLos(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1023,7 +1023,7 @@ pub mod msg_ssr_flag_satellites { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrFlagSatellites(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1126,7 +1126,7 @@ pub mod msg_ssr_flag_tropo_grid_points { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrFlagTropoGridPoints(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/linux.rs b/rust/sbp/src/messages/linux.rs index e5fca7b5ae..9aa661ae28 100644 --- a/rust/sbp/src/messages/linux.rs +++ b/rust/sbp/src/messages/linux.rs @@ -110,7 +110,7 @@ pub mod msg_linux_cpu_state { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgLinuxCpuState(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -249,7 +249,7 @@ pub mod msg_linux_cpu_state_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgLinuxCpuStateDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -372,7 +372,7 @@ pub mod msg_linux_mem_state { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgLinuxMemState(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -511,7 +511,7 @@ pub mod msg_linux_mem_state_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgLinuxMemStateDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -608,7 +608,7 @@ pub mod msg_linux_process_fd_count { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgLinuxProcessFdCount(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -699,7 +699,7 @@ pub mod msg_linux_process_fd_summary { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgLinuxProcessFdSummary(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -793,7 +793,7 @@ pub mod msg_linux_process_socket_counts { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgLinuxProcessSocketCounts(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -911,7 +911,7 @@ pub mod msg_linux_process_socket_queues { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgLinuxProcessSocketQueues(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1024,7 +1024,7 @@ pub mod msg_linux_socket_usage { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgLinuxSocketUsage(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1146,7 +1146,7 @@ pub mod msg_linux_sys_state { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgLinuxSysState(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1291,7 +1291,7 @@ pub mod msg_linux_sys_state_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgLinuxSysStateDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/logging.rs b/rust/sbp/src/messages/logging.rs index 369cb15ca6..71bd985d13 100644 --- a/rust/sbp/src/messages/logging.rs +++ b/rust/sbp/src/messages/logging.rs @@ -80,7 +80,7 @@ pub mod msg_fwd { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFwd(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -181,7 +181,7 @@ pub mod msg_log { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgLog(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -316,7 +316,7 @@ pub mod msg_print_dep { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPrintDep(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/mag.rs b/rust/sbp/src/messages/mag.rs index ebeb4c9d59..09a9eb3ed5 100644 --- a/rust/sbp/src/messages/mag.rs +++ b/rust/sbp/src/messages/mag.rs @@ -87,7 +87,7 @@ pub mod msg_mag_raw { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgMagRaw(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/mod.rs b/rust/sbp/src/messages/mod.rs index bd511a2be7..e0a8a5ae0b 100644 --- a/rust/sbp/src/messages/mod.rs +++ b/rust/sbp/src/messages/mod.rs @@ -336,7 +336,7 @@ pub trait ConcreteMessage: SbpMessage + TryFrom { /// The error returned when using [TryFrom] to convert [Sbp] to the wrong message type. #[derive(Debug, Clone)] -pub struct TryFromSbpError; +pub struct TryFromSbpError(pub Sbp); impl std::fmt::Display for TryFromSbpError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/rust/sbp/src/messages/navigation.rs b/rust/sbp/src/messages/navigation.rs index 294223d752..80fdf4802b 100644 --- a/rust/sbp/src/messages/navigation.rs +++ b/rust/sbp/src/messages/navigation.rs @@ -190,7 +190,7 @@ pub mod msg_age_corrections { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgAgeCorrections(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -310,7 +310,7 @@ pub mod msg_baseline_ecef { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgBaselineEcef(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -520,7 +520,7 @@ pub mod msg_baseline_ecef_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgBaselineEcefDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -776,7 +776,7 @@ pub mod msg_baseline_heading_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgBaselineHeadingDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1007,7 +1007,7 @@ pub mod msg_baseline_ned { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgBaselineNed(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1226,7 +1226,7 @@ pub mod msg_baseline_ned_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgBaselineNedDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1479,7 +1479,7 @@ pub mod msg_dops { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgDops(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1655,7 +1655,7 @@ pub mod msg_dops_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgDopsDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1797,7 +1797,7 @@ pub mod msg_gps_time { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgGpsTime(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1950,7 +1950,7 @@ pub mod msg_gps_time_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgGpsTimeDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2084,7 +2084,7 @@ pub mod msg_gps_time_gnss { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgGpsTimeGnss(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2335,7 +2335,7 @@ pub mod msg_pose_relative { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPoseRelative(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2666,7 +2666,7 @@ pub mod msg_pos_ecef { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPosEcef(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2973,7 +2973,7 @@ pub mod msg_pos_ecef_cov { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPosEcefCov(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -3269,7 +3269,7 @@ pub mod msg_pos_ecef_cov_gnss { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPosEcefCovGnss(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -3512,7 +3512,7 @@ pub mod msg_pos_ecef_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPosEcefDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -3758,7 +3758,7 @@ pub mod msg_pos_ecef_gnss { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPosEcefGnss(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -3987,7 +3987,7 @@ pub mod msg_pos_llh { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPosLlh(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -4346,7 +4346,7 @@ pub mod msg_pos_llh_acc { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPosLlhAcc(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -4747,7 +4747,7 @@ pub mod msg_pos_llh_cov { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPosLlhCov(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -5043,7 +5043,7 @@ pub mod msg_pos_llh_cov_gnss { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPosLlhCovGnss(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -5308,7 +5308,7 @@ pub mod msg_pos_llh_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPosLlhDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -5593,7 +5593,7 @@ pub mod msg_pos_llh_gnss { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPosLlhGnss(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -6006,7 +6006,7 @@ pub mod msg_protection_level { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgProtectionLevel(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -6328,7 +6328,7 @@ pub mod msg_protection_level_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgProtectionLevelDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -6519,7 +6519,7 @@ pub mod msg_reference_frame_param { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgReferenceFrameParam(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -6693,7 +6693,7 @@ pub mod msg_utc_leap_second { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgUtcLeapSecond(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -6862,7 +6862,7 @@ pub mod msg_utc_time { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgUtcTime(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -7101,7 +7101,7 @@ pub mod msg_utc_time_gnss { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgUtcTimeGnss(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -7355,7 +7355,7 @@ pub mod msg_vel_body { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgVelBody(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -7684,7 +7684,7 @@ pub mod msg_vel_cog { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgVelCog(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -8079,7 +8079,7 @@ pub mod msg_vel_ecef { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgVelEcef(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -8363,7 +8363,7 @@ pub mod msg_vel_ecef_cov { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgVelEcefCov(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -8639,7 +8639,7 @@ pub mod msg_vel_ecef_cov_gnss { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgVelEcefCovGnss(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -8819,7 +8819,7 @@ pub mod msg_vel_ecef_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgVelEcefDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -8960,7 +8960,7 @@ pub mod msg_vel_ecef_gnss { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgVelEcefGnss(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -9168,7 +9168,7 @@ pub mod msg_vel_ned { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgVelNed(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -9459,7 +9459,7 @@ pub mod msg_vel_ned_cov { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgVelNedCov(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -9738,7 +9738,7 @@ pub mod msg_vel_ned_cov_gnss { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgVelNedCovGnss(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -9922,7 +9922,7 @@ pub mod msg_vel_ned_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgVelNedDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -10071,7 +10071,7 @@ pub mod msg_vel_ned_gnss { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgVelNedGnss(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/ndb.rs b/rust/sbp/src/messages/ndb.rs index 119ac9a204..fb549b2ee1 100644 --- a/rust/sbp/src/messages/ndb.rs +++ b/rust/sbp/src/messages/ndb.rs @@ -152,7 +152,7 @@ pub mod msg_ndb_event { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgNdbEvent(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/observation.rs b/rust/sbp/src/messages/observation.rs index 25db874bc9..5743711835 100644 --- a/rust/sbp/src/messages/observation.rs +++ b/rust/sbp/src/messages/observation.rs @@ -734,7 +734,7 @@ pub mod msg_almanac_glo { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgAlmanacGlo(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -860,7 +860,7 @@ pub mod msg_almanac_glo_dep { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgAlmanacGloDep(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -991,7 +991,7 @@ pub mod msg_almanac_gps { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgAlmanacGps(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1130,7 +1130,7 @@ pub mod msg_almanac_gps_dep { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgAlmanacGpsDep(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1249,7 +1249,7 @@ pub mod msg_base_pos_ecef { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgBasePosEcef(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1337,7 +1337,7 @@ pub mod msg_base_pos_llh { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgBasePosLlh(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1496,7 +1496,7 @@ pub mod msg_ephemeris_bds { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisBds(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1740,7 +1740,7 @@ pub mod msg_ephemeris_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1995,7 +1995,7 @@ pub mod msg_ephemeris_dep_b { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisDepB(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2263,7 +2263,7 @@ pub mod msg_ephemeris_dep_c { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisDepC(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2539,7 +2539,7 @@ pub mod msg_ephemeris_dep_d { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisDepD(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2803,7 +2803,7 @@ pub mod msg_ephemeris_gal { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisGal(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -3046,7 +3046,7 @@ pub mod msg_ephemeris_gal_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisGalDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -3238,7 +3238,7 @@ pub mod msg_ephemeris_glo { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisGlo(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -3361,7 +3361,7 @@ pub mod msg_ephemeris_glo_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisGloDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -3472,7 +3472,7 @@ pub mod msg_ephemeris_glo_dep_b { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisGloDepB(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -3589,7 +3589,7 @@ pub mod msg_ephemeris_glo_dep_c { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisGloDepC(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -3715,7 +3715,7 @@ pub mod msg_ephemeris_glo_dep_d { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisGloDepD(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -3893,7 +3893,7 @@ pub mod msg_ephemeris_gps { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisGps(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -4127,7 +4127,7 @@ pub mod msg_ephemeris_gps_dep_e { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisGpsDepE(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -4359,7 +4359,7 @@ pub mod msg_ephemeris_gps_dep_f { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisGpsDepF(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -4591,7 +4591,7 @@ pub mod msg_ephemeris_qzss { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisQzss(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -4763,7 +4763,7 @@ pub mod msg_ephemeris_sbas { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisSbas(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -4867,7 +4867,7 @@ pub mod msg_ephemeris_sbas_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisSbasDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -4976,7 +4976,7 @@ pub mod msg_ephemeris_sbas_dep_b { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEphemerisSbasDepB(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -5083,7 +5083,7 @@ pub mod msg_glo_biases { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgGloBiases(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -5171,7 +5171,7 @@ pub mod msg_gnss_capb { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgGnssCapb(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -5260,7 +5260,7 @@ pub mod msg_group_delay { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgGroupDelay(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -5366,7 +5366,7 @@ pub mod msg_group_delay_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgGroupDelayDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -5472,7 +5472,7 @@ pub mod msg_group_delay_dep_b { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgGroupDelayDepB(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -5583,7 +5583,7 @@ pub mod msg_iono { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgIono(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -5709,7 +5709,7 @@ pub mod msg_obs { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgObs(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -5801,7 +5801,7 @@ pub mod msg_obs_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgObsDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -5896,7 +5896,7 @@ pub mod msg_obs_dep_b { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgObsDepB(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -5993,7 +5993,7 @@ pub mod msg_obs_dep_c { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgObsDepC(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -6086,7 +6086,7 @@ pub mod msg_osr { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgOsr(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -6163,7 +6163,7 @@ pub mod msg_sv_az_el { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSvAzEl(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -6239,7 +6239,7 @@ pub mod msg_sv_configuration_gps_dep { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSvConfigurationGpsDep(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/orientation.rs b/rust/sbp/src/messages/orientation.rs index a1c203f327..03a498f208 100644 --- a/rust/sbp/src/messages/orientation.rs +++ b/rust/sbp/src/messages/orientation.rs @@ -113,7 +113,7 @@ pub mod msg_angular_rate { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgAngularRate(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -269,7 +269,7 @@ pub mod msg_baseline_heading { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgBaselineHeading(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -444,7 +444,7 @@ pub mod msg_orient_euler { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgOrientEuler(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -631,7 +631,7 @@ pub mod msg_orient_quat { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgOrientQuat(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/piksi.rs b/rust/sbp/src/messages/piksi.rs index 8511ff5e9c..8c2171fc42 100644 --- a/rust/sbp/src/messages/piksi.rs +++ b/rust/sbp/src/messages/piksi.rs @@ -154,7 +154,7 @@ pub mod msg_almanac { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgAlmanac(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -230,7 +230,7 @@ pub mod msg_cell_modem_status { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgCellModemStatus(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -316,7 +316,7 @@ pub mod msg_command_output { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgCommandOutput(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -397,7 +397,7 @@ pub mod msg_command_req { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgCommandReq(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -477,7 +477,7 @@ pub mod msg_command_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgCommandResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -551,7 +551,7 @@ pub mod msg_cw_results { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgCwResults(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -618,7 +618,7 @@ pub mod msg_cw_start { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgCwStart(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -700,7 +700,7 @@ pub mod msg_device_monitor { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgDeviceMonitor(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -798,7 +798,7 @@ pub mod msg_front_end_gain { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgFrontEndGain(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -875,7 +875,7 @@ pub mod msg_iar_state { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgIarState(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -945,7 +945,7 @@ pub mod msg_init_base_dep { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgInitBaseDep(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1047,7 +1047,7 @@ pub mod msg_mask_satellite { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgMaskSatellite(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1219,7 +1219,7 @@ pub mod msg_mask_satellite_dep { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgMaskSatelliteDep(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1358,7 +1358,7 @@ pub mod msg_network_bandwidth_usage { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgNetworkBandwidthUsage(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1429,7 +1429,7 @@ pub mod msg_network_state_req { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgNetworkStateReq(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1739,7 +1739,7 @@ pub mod msg_network_state_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgNetworkStateResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1856,7 +1856,7 @@ pub mod msg_reset { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgReset(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1958,7 +1958,7 @@ pub mod msg_reset_dep { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgResetDep(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2046,7 +2046,7 @@ pub mod msg_reset_filters { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgResetFilters(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2152,7 +2152,7 @@ pub mod msg_set_time { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSetTime(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2238,7 +2238,7 @@ pub mod msg_specan { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSpecan(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2353,7 +2353,7 @@ pub mod msg_specan_dep { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSpecanDep(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2459,7 +2459,7 @@ pub mod msg_thread_state { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgThreadState(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2559,7 +2559,7 @@ pub mod msg_uart_state { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgUartState(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2657,7 +2657,7 @@ pub mod msg_uart_state_depa { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgUartStateDepa(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/sbas.rs b/rust/sbp/src/messages/sbas.rs index 7f8433cfe7..b56dcee891 100644 --- a/rust/sbp/src/messages/sbas.rs +++ b/rust/sbp/src/messages/sbas.rs @@ -85,7 +85,7 @@ pub mod msg_sbas_raw { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSbasRaw(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/settings.rs b/rust/sbp/src/messages/settings.rs index 4f316bf587..897b5415e9 100644 --- a/rust/sbp/src/messages/settings.rs +++ b/rust/sbp/src/messages/settings.rs @@ -96,7 +96,7 @@ pub mod msg_settings_read_by_index_done { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSettingsReadByIndexDone(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -165,7 +165,7 @@ pub mod msg_settings_read_by_index_req { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSettingsReadByIndexReq(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -251,7 +251,7 @@ pub mod msg_settings_read_by_index_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSettingsReadByIndexResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -334,7 +334,7 @@ pub mod msg_settings_read_req { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSettingsReadReq(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -412,7 +412,7 @@ pub mod msg_settings_read_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSettingsReadResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -487,7 +487,7 @@ pub mod msg_settings_register { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSettingsRegister(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -583,7 +583,7 @@ pub mod msg_settings_register_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSettingsRegisterResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -708,7 +708,7 @@ pub mod msg_settings_save { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSettingsSave(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -782,7 +782,7 @@ pub mod msg_settings_write { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSettingsWrite(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -880,7 +880,7 @@ pub mod msg_settings_write_resp { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSettingsWriteResp(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/signing.rs b/rust/sbp/src/messages/signing.rs index 79c4a0581c..3d6e9d83ad 100644 --- a/rust/sbp/src/messages/signing.rs +++ b/rust/sbp/src/messages/signing.rs @@ -72,7 +72,7 @@ pub mod msg_ed25519_certificate { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEd25519Certificate(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -168,7 +168,7 @@ pub mod msg_ed25519_signature { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEd25519Signature(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -259,7 +259,7 @@ pub mod msg_ed25519_signature_dep { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgEd25519SignatureDep(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/solution_meta.rs b/rust/sbp/src/messages/solution_meta.rs index fdb90105dc..d64f33f1dd 100644 --- a/rust/sbp/src/messages/solution_meta.rs +++ b/rust/sbp/src/messages/solution_meta.rs @@ -437,7 +437,7 @@ pub mod msg_soln_meta { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSolnMeta(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -619,7 +619,7 @@ pub mod msg_soln_meta_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSolnMetaDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/ssr.rs b/rust/sbp/src/messages/ssr.rs index a04d42fbc4..5353040c39 100644 --- a/rust/sbp/src/messages/ssr.rs +++ b/rust/sbp/src/messages/ssr.rs @@ -525,7 +525,7 @@ pub mod msg_ssr_code_biases { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrCodeBiases(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -622,7 +622,7 @@ pub mod msg_ssr_code_phase_biases_bounds { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrCodePhaseBiasesBounds(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -722,7 +722,7 @@ pub mod msg_ssr_gridded_correction { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrGriddedCorrection(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -845,7 +845,7 @@ pub mod msg_ssr_gridded_correction_bounds { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrGriddedCorrectionBounds(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -971,7 +971,7 @@ pub mod msg_ssr_gridded_correction_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrGriddedCorrectionDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1061,7 +1061,7 @@ pub mod msg_ssr_gridded_correction_no_std_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrGriddedCorrectionNoStdDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1148,7 +1148,7 @@ pub mod msg_ssr_grid_definition_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrGridDefinitionDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1267,7 +1267,7 @@ pub mod msg_ssr_orbit_clock { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrOrbitClock(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1408,7 +1408,7 @@ pub mod msg_ssr_orbit_clock_bounds { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrOrbitClockBounds(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1507,7 +1507,7 @@ pub mod msg_ssr_orbit_clock_bounds_degradation { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrOrbitClockBoundsDegradation(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1633,7 +1633,7 @@ pub mod msg_ssr_orbit_clock_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrOrbitClockDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1788,7 +1788,7 @@ pub mod msg_ssr_phase_biases { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrPhaseBiases(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1889,7 +1889,7 @@ pub mod msg_ssr_satellite_apc { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrSatelliteApc(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1973,7 +1973,7 @@ pub mod msg_ssr_stec_correction { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrStecCorrection(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2074,7 +2074,7 @@ pub mod msg_ssr_stec_correction_dep { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrStecCorrectionDep(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2149,7 +2149,7 @@ pub mod msg_ssr_stec_correction_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrStecCorrectionDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2296,7 +2296,7 @@ pub mod msg_ssr_tile_definition { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrTileDefinition(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2473,7 +2473,7 @@ pub mod msg_ssr_tile_definition_dep { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSsrTileDefinitionDep(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/system.rs b/rust/sbp/src/messages/system.rs index 222938ebc0..6dbbc91470 100644 --- a/rust/sbp/src/messages/system.rs +++ b/rust/sbp/src/messages/system.rs @@ -85,7 +85,7 @@ pub mod msg_csac_telemetry { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgCsacTelemetry(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -166,7 +166,7 @@ pub mod msg_csac_telemetry_labels { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgCsacTelemetryLabels(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -268,7 +268,7 @@ pub mod msg_dgnss_status { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgDgnssStatus(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -398,7 +398,7 @@ pub mod msg_gnss_time_offset { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgGnssTimeOffset(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -510,7 +510,7 @@ pub mod msg_group_meta { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgGroupMeta(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -752,7 +752,7 @@ pub mod msg_heartbeat { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgHeartbeat(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1081,7 +1081,7 @@ pub mod msg_ins_status { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgInsStatus(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1691,7 +1691,7 @@ pub mod msg_ins_updates { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgInsUpdates(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1827,7 +1827,7 @@ pub mod msg_pps_time { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgPpsTime(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -1981,7 +1981,7 @@ pub mod msg_sensor_aid_event { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgSensorAidEvent(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2178,7 +2178,7 @@ pub mod msg_startup { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgStartup(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2399,7 +2399,7 @@ pub mod msg_status_journal { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgStatusJournal(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2592,7 +2592,7 @@ pub mod msg_status_report { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgStatusReport(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/tracking.rs b/rust/sbp/src/messages/tracking.rs index edcdcc343a..ab14ff2c7b 100644 --- a/rust/sbp/src/messages/tracking.rs +++ b/rust/sbp/src/messages/tracking.rs @@ -82,7 +82,7 @@ pub mod msg_measurement_state { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgMeasurementState(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -162,7 +162,7 @@ pub mod msg_tracking_iq { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgTrackingIq(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -249,7 +249,7 @@ pub mod msg_tracking_iq_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgTrackingIqDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -337,7 +337,7 @@ pub mod msg_tracking_iq_dep_b { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgTrackingIqDepB(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -420,7 +420,7 @@ pub mod msg_tracking_state { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgTrackingState(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -493,7 +493,7 @@ pub mod msg_tracking_state_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgTrackingStateDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -566,7 +566,7 @@ pub mod msg_tracking_state_dep_b { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgTrackingStateDepB(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -985,7 +985,7 @@ pub mod msg_tracking_state_detailed_dep { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgTrackingStateDetailedDep(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -2003,7 +2003,7 @@ pub mod msg_tracking_state_detailed_dep_a { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgTrackingStateDetailedDepA(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/user.rs b/rust/sbp/src/messages/user.rs index 9af15b2dae..cd706b4c2d 100644 --- a/rust/sbp/src/messages/user.rs +++ b/rust/sbp/src/messages/user.rs @@ -66,7 +66,7 @@ pub mod msg_user_data { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgUserData(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } diff --git a/rust/sbp/src/messages/vehicle.rs b/rust/sbp/src/messages/vehicle.rs index d2a38ced7c..d649c625ee 100644 --- a/rust/sbp/src/messages/vehicle.rs +++ b/rust/sbp/src/messages/vehicle.rs @@ -135,7 +135,7 @@ pub mod msg_odometry { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgOdometry(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } } @@ -397,7 +397,7 @@ pub mod msg_wheeltick { fn try_from(msg: Sbp) -> Result { match msg { Sbp::MsgWheeltick(m) => Ok(m), - _ => Err(TryFromSbpError), + _ => Err(TryFromSbpError(msg)), } } }