Skip to content

Commit

Permalink
var_abstract: Use the string representation of Type.
Browse files Browse the repository at this point in the history
At the moment some Status and Log messages log the var Type enum which will just be an integer. Change this to use the string representation of the enum type.

PiperOrigin-RevId: 608954450
Change-Id: I24447320b5f6f9f8ed22c91ca41f602bdf2ddbb8
  • Loading branch information
okunz authored and copybara-github committed Feb 21, 2024
1 parent 008b45c commit 2cacad6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sandboxed_api/var_abstract.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "sandboxed_api/util/raw_logging.h"
#include "sandboxed_api/util/status_macros.h"
#include "sandboxed_api/var_ptr.h"
#include "sandboxed_api/var_type.h"

namespace sapi::v {

Expand Down Expand Up @@ -98,9 +99,10 @@ absl::Status Var::TransferToSandboxee(RPCChannel* rpc_channel, pid_t pid) {
<< ", size: " << GetSize();

if (remote_ == nullptr) {
LOG(WARNING) << "Object: " << GetType() << " has no remote object set";
LOG(WARNING) << "Object: " << GetTypeString()
<< " has no remote object set";
return absl::FailedPreconditionError(
absl::StrCat("Object: ", GetType(), " has no remote object set"));
absl::StrCat("Object: ", GetTypeString(), " has no remote object set"));
}

struct iovec local = {
Expand Down Expand Up @@ -136,7 +138,7 @@ absl::Status Var::TransferFromSandboxee(RPCChannel* rpc_channel, pid_t pid) {

if (local_ == nullptr) {
return absl::FailedPreconditionError(
absl::StrCat("Object: ", GetType(), " has no local storage set"));
absl::StrCat("Object: ", GetTypeString(), " has no local storage set"));
}

struct iovec local = {
Expand Down

0 comments on commit 2cacad6

Please sign in to comment.