Skip to content

Compono.CompositionException.WithSeedInMessage(Compono.CompositionException,int)

Compono

Compono.CompositionException

CompositionException.WithSeedInMessage(CompositionException, int) Method

Creates a copy of original whose System.Exception.Message has a "Seed: <value>" line appended, so a consumer building custom composition-failure tooling (e.g. a test-framework integration reporting a reproducible seed) can surface it without needing Diagnostic to be present - Diagnostic already renders its own "Seed:" line via ToString() when it's there, but not every CompositionException has one (a plain CompositionException(string), e.g. a generated collection plan's unique-value-exhaustion failure, has none).

public static Compono.CompositionException WithSeedInMessage(Compono.CompositionException original, int seed);

Parameters

original CompositionException

The exception to copy and append the seed to.

seed System.Int32

The seed value to append.

Returns

CompositionException
A new CompositionException whose Diagnostic is original's, unchanged (null stays null), and whose System.Exception.InnerException is original itself - so a provider failure's full chain becomes this new exception, then original, then whatever original's own System.Exception.InnerException was (if any), one level deeper than the original throw.

Exceptions

System.ArgumentNullException
original is null.