Skip to content

Solidify output formatter implementations #625

@oschaaf

Description

@oschaaf

It would be good to go over the output formatter implementations and ensure that there are no ASSERT paths that can be hit when better handling of the condition that triggered it would be available.
At the time of writing this there are two known ones:

  • In some of the OutputFormatter implementations we rely on getJsonStringFromMessageOrDie,
    which was introduced recently in an Envoy update. There's a variant of this method which doesn't die but instead returns an absl::Status, and that could be leveraged to enhance the flow here.
  • The Fortio output formatter has a known path where it asserts when there are no a global result. This is suboptimal, as this can happen with some arguably silly yet valid configurations. Instead it would be better to instruct the Fortio UI to display an error, for which there are flags in its input json.

In general, it should be rare for any output formatter to terminate abnormally, but input can be transformed into output that reflects an error in the target format.

Context: this came up in review of #621
Note: this affects only the CLI, and not the service, therefore we consider it not critical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions