From f85317fb437a908f69031f7a420d4cade6c661a3 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 26 Dec 2022 09:22:24 -0800 Subject: [PATCH] Make an error message more informative From https://android-build.googleplex.com/builds/tests/view?testResultId=TR66328435937757440&invocationId=I00700010119503421: system/core/init/init_test.cpp:219: Failure Failed Value of: service->Start() Actual: createProcessGroup(0, 15611) failed for service 'console' Expected: is ok The above error message does not contain enough information to root-cause the test failure. Hence this CL that makes an error message more informative. Bug: 262090304 Change-Id: I09929b2f2aabf1eec4d90ec93234a9e968888da4 Signed-off-by: Bart Van Assche --- init/service.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init/service.cpp b/init/service.cpp index d495b9102..b9b33090e 100644 --- a/init/service.cpp +++ b/init/service.cpp @@ -700,8 +700,9 @@ Result Service::Start() { if (!result.ok()) { return Error() << "Sending notification failed: " << result.error(); } - return Error() << "createProcessGroup(" << proc_attr_.uid << ", " << pid_ - << ") failed for service '" << name_ << "'"; + return Error() << "createProcessGroup(" << proc_attr_.uid << ", " << pid_ << ", " + << use_memcg << ") failed for service '" << name_ + << "': " << strerror(errno); } // When the blkio controller is mounted in the v1 hierarchy, NormalIoPriority is