From 03e905e304d2253dfcd0019105337df23e72d80c Mon Sep 17 00:00:00 2001 From: Stephen Wakely Date: Tue, 2 May 2023 14:22:00 +0100 Subject: [PATCH] chore: add note to DEVELOPING.md re panics (#17277) Add note to DEVELOPING re panics Signed-off-by: Stephen Wakely --- docs/DEVELOPING.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/DEVELOPING.md b/docs/DEVELOPING.md index bb5cd0af05649..31a91795b7b75 100644 --- a/docs/DEVELOPING.md +++ b/docs/DEVELOPING.md @@ -218,6 +218,17 @@ Yep! warn!(message = "Failed to merge value.", %error); ``` +#### Panics + +As a general rule, code in Vector should *not* panic. + +However, there are very rare situations where the code makes certain assumptions +about the given state and if those assumptions are not met this is clearly due +to a bug within Vector. In this situation Vector cannot safely proceed. Issuing +a panic here is acceptable. + +All potential panics *MUST* be clearly documented in the function documentation. + ### Feature flags When a new component (a source, transform, or sink) is added, it has to be put