var_abstract: Use the string representation of Type.

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
main
Oliver Kunz 2024-02-21 05:11:15 -08:00 committed by Copybara-Service
parent 008b45c9b7
commit 2cacad6008
1 changed files with 5 additions and 3 deletions

View File

@ -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 {
@ -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 = {
@ -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 = {