Skip to content

address comments

a9ee712
Select commit
Loading
Failed to load commit list.
Open

Remove C++ exceptions from SystemTimeFormatter and derived classes #45372

address comments
a9ee712
Select commit
Loading
Failed to load commit list.
CI (Envoy) / Mobile/Coverage skipped Jun 2, 2026 in 0s

Check was skipped

This check was not triggered in this CI run

Details

Request (pr/45372/main@a9ee712)

yanavlasov @yanavlasov a9ee712 #45372 merge main@f1063bb

Remove C++ exceptions from SystemTimeFormatter and derived classes

Replace constructors that can throw with a factory method that returns StatusOr<> for SystemTimeFormatter and derived classes. There should be no functional changes, as there is still a throw present when a factory method fails.

Test changes are all conversions from direct construction to a factory method.

In the subsequent PRs I will generalize the makeTimeFormatter so it can be used with generic types.

There are boilerplate checkConstructPreconditions method in the derived classes that just call the base class. They are not strictly needed, and I have left them, just to so I can use this as pattern for agents that will work on implementing this pattern for other types where derived classes have their own preconditions.

Risk Level: low
Testing: unit tests
Docs Changes: no
Release Notes: no
Platform Specific Features: no

Environment

Request variables

Key Value
ref 113228b
sha a9ee712
pr 45372
base-sha f1063bb
actor yanavlasov @yanavlasov
message Remove C++ exceptions from SystemTimeFormatter and derived classes...
started 1780409327.34096
target-branch main
trusted false
Build image

Container image/s (as used in this CI run)

Key Value
default docker.io/envoyproxy/envoy-build:v0.1.5
mobile docker.io/envoyproxy/envoy-build:mobile-v0.1.5
Version

Envoy version (as used in this CI run)

Key Value
major 1
minor 39
patch 0
dev true