From bbc9b4e9587ef0c58bd035c532e2c925e7611f99 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Mon, 29 Mar 2021 16:53:03 +0800 Subject: profcollectd: keep the entire error backtrace in Binder result Show the error and all of its "causes" through Binder result, instead of just the top context. Test: Trigger an error Bug: 79161490 Change-Id: I538ff70069fb0e79faefde09f09dca164ea7aebf --- profcollectd/libprofcollectd/service.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'profcollectd') diff --git a/profcollectd/libprofcollectd/service.rs b/profcollectd/libprofcollectd/service.rs index 58b257de..94287e1d 100644 --- a/profcollectd/libprofcollectd/service.rs +++ b/profcollectd/libprofcollectd/service.rs @@ -34,7 +34,8 @@ use crate::report::pack_report; use crate::scheduler::Scheduler; fn err_to_binder_status(msg: Error) -> Status { - let msg = CString::new(msg.to_string()).expect("Failed to convert to CString"); + let msg = format!("{:#?}", msg); + let msg = CString::new(msg).expect("Failed to convert to CString"); Status::new_service_specific_error(1, Some(&msg)) } -- cgit v1.2.3