remove the exception throwing in filterState data fetching, maybe use statusOr instead.
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 428
Description
*Title*: remove the exception throwing in filterState data fetching, maybe use statusOr instead.
*Description*:
https://github.com/envoyproxy/envoy/pull/20791 changed the rule of exception throwing in Envoy data-plane, let's remove the exception-throwing code in FilterState. Presumably return StatusOr or Status to indicate the error instead.
```
void FilterStateImpl::setData(absl::string_view data_name, std::shared_ptr data,
FilterState::StateType state_type, FilterState::LifeSpan life_span) {
if (life_span > life_span_) {
if (hasDataWithNameInternally(data_name)) {
throw EnvoyException(
"FilterState::setData called twice with conflicting life_span on the same data_name.");
}
maybeCreateParent(ParentAccessMode::ReadWrite);
parent_->setData(data_name, data, state_type, life_span);
return;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.