[fix][dbus] Improve vague error messages for D-Bus service register/unregister failures#1752
Conversation
Replace vague error messages in registerDBusService() and unregisterDBusService() with descriptive messages that include the service name and use proper ErrorCode::Failed instead of FIXME placeholders. Before: - registerService error: "name: message" / "service name existed." - unregisterService error: "name: message" / "unknown" After: - registerService error: "failed to register D-Bus service 'name': message" - unregisterService error: "failed to unregister D-Bus service 'name': message" - Service already registered: "D-Bus service name 'name' already registered" - Service not found: "D-Bus service name 'name' not found" Signed-off-by: zhaohaihzb <zhaohaihzb@126.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zhaohai666 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @zhaohai666. Thanks for your PR. I'm waiting for a OpenAtom-Linyaps member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Code Review
This pull request updates the D-Bus registration and unregistration functions in register.h to use proper error codes (utils::error::ErrorCode::Failed) and provides more descriptive error messages that include the service name. There are no review comments to address, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
Original error messages for D-Bus service registration and unregistration failures were overly generic and lack necessary context:
service name existed.unknownBoth messages missed the target service name and corresponding error code.
Changes
Registration conflict error in
registerDBusServiceReplace plain text
service name existed.with formatted message:fmt::format("D-Bus service name '{}' already registered", serviceName)Attach
ErrorCode::Failedto the error.Not-found error in
unregisterDBusServiceReplace plain text
unknownwith formatted message:fmt::format("D-Bus service name '{}' not found", serviceName)Attach
ErrorCode::Failedto the error.Modified File
libs/linglong/src/linglong/common/dbus/register.hBenefits