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
This commit is contained in:
ysq
2025-11-27 22:13:35 +08:00
parent 0e491a8b80
commit 25fa295994
+11 -2
View File
@@ -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);
}
}
}