Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7bcce33 authored by Sandeep Dhavale's avatar Sandeep Dhavale
Browse files

libsnapshot: log message when the WaitForDeviceDelete() fails



Currently when WaitForDeviceDelete() fails, we only log a failure
message without the reason even if snapuserd sent it.

Logging a message will tell us more if snapuserd failed to
do the operation for some reason or did it crash.

This is not fix but a change to get more information in failure path.

Bug: 402491858

Test: th
Change-Id: I30339d983a56133359400e423678d02b9d0f4e4f
Signed-off-by: default avatarSandeep Dhavale <dhavale@google.com>
parent 7910ccb5
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -190,7 +190,8 @@ bool SnapuserdClient::WaitForDeviceDelete(const std::string& control_device) {
    }
    std::string response = Receivemsg();
    if (response != "success") {
        LOG(ERROR) << "Failed waiting to delete device " << control_device;
        LOG(ERROR) << "Failed waiting to delete device " << control_device << " received:'"
                   << response << "'";
        return false;
    }
    return true;
@@ -214,7 +215,7 @@ std::string SnapuserdClient::Receivemsg() {
        return {};
    }
    if (ret == 0) {
        LOG(DEBUG) << "Snapuserd:client disconnected";
        LOG(INFO) << "Snapuserd:client disconnected";
        return {};
    }
    return std::string(msg, ret);