Adding API for getting the current PolicyBuilder status.

PiperOrigin-RevId: 612892145
Change-Id: Iaf36e1c1064bac080b0115480212067d96756a2b
This commit is contained in:
Sandboxed API Team 2024-03-05 10:35:10 -08:00 committed by Copybara-Service
parent c8a26fbfa0
commit 1f390c279e

View File

@ -744,6 +744,9 @@ class PolicyBuilder final {
PolicyBuilder& AllowIPv4(const std::string& ip_and_mask, uint32_t port = 0);
PolicyBuilder& AllowIPv6(const std::string& ip_and_mask, uint32_t port = 0);
// Returns the current status of the PolicyBuilder.
absl::Status GetStatus() { return last_status_; }
private:
friend class PolicyBuilderPeer; // For testing
friend class StackTracePeer;
@ -810,7 +813,7 @@ class PolicyBuilder final {
absl::flat_hash_set<uint32_t> handled_syscalls_;
// Error handling
absl::Status last_status_;
absl::Status last_status_ = absl::OkStatus();
bool already_built_ = false;
struct {