| 128 | } |
| 129 | |
| 130 | bool IsUnknownFunctionResultError(const Value& result) { |
| 131 | if (!result->Is<cel::ErrorValue>()) { |
| 132 | return false; |
| 133 | } |
| 134 | |
| 135 | const auto& status = result.GetError().NativeValue(); |
| 136 | |
| 137 | if (status.code() != absl::StatusCode::kUnavailable) { |
| 138 | return false; |
| 139 | } |
| 140 | auto payload = status.GetPayload( |
| 141 | cel::runtime_internal::kPayloadUrlUnknownFunctionResult); |
| 142 | return payload.has_value() && payload.value() == "true"; |
| 143 | } |
| 144 | |
| 145 | // Simple wrapper around a function resolution result. A function call should |
| 146 | // resolve to a single function implementation and a descriptor or none. |