-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Title: Introduce error pathway to optionally replace local reply behavior when Envoy is built and run as a library.
Description: This issue is primarily in support of Envoy Mobile, but it applies in any case where Envoy is built into another binary, and it's desirable for errors to be surfaced via a code path that can be handled by the enclosed binary, as opposed to via locally-generated HTTP replies.
Currently, Envoy Mobile maps non-2xx local replies to its error pathway, but this mechanism is brittle and introduces numerous edge cases, especially with filters. The proposal here is to replace calls that use sendLocalReply to surface errors with a more generic and configurable raiseError interface. The default behavior for this interface would still be to generate a local reply, maintaining Envoy's existing behavior. In the case of Envoy Mobile (and other library usage), however, this behavior can then be overridden to surface the error directly via a public error handling API.