From 25fa2959946f212c3f8fc90f281f7a8368f75215 Mon Sep 17 00:00:00 2001 From: ysq Date: Thu, 27 Nov 2025 22:13:35 +0800 Subject: [PATCH] feat(swqos): enhance error message collection from transaction logs Improve error message extraction in poll_transaction_confirmation to: - Collect multiple error messages instead of stopping at the first one - Add support for "Program log: Error: " format in addition to "Error Message: " - Concatenate multiple errors with semicolon separator for comprehensive error reporting --- src/swqos/common.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/swqos/common.rs b/src/swqos/common.rs index 30a7e88..443d855 100755 --- a/src/swqos/common.rs +++ b/src/swqos/common.rs @@ -115,8 +115,17 @@ pub async fn poll_transaction_confirmation( { for log in logs { if let Some(idx) = log.find("Error Message: ") { - error_msg = log[idx + 15..].trim_end_matches('.').to_string(); - break; + let msg = log[idx + 15..].trim_end_matches('.').to_string(); + if !error_msg.is_empty() { + error_msg.push_str("; "); + } + error_msg.push_str(&msg); + } else if let Some(idx) = log.find("Program log: Error: ") { + let msg = log[idx + 20..].trim_end_matches('.').to_string(); + if !error_msg.is_empty() { + error_msg.push_str("; "); + } + error_msg.push_str(&msg); } } }