Compono.CompositionException
Compono¶
Compono¶
CompositionException Class¶
Thrown when a composition request reaches the resolution pipeline's terminal stage - no explicit value, shared value, registration, provider, or generated plan could satisfy it.
Inheritance System.Object → System.Exception → CompositionException
Remarks¶
This is the thrown-exception boundary docs/public-api.md's examples catch - Resolve<TValue>(CompositionRequestDescriptor) must return a plain TValue, so a terminal non-success pipeline outcome has no return-value channel to report through and converts to this exception instead, per docs/adr/0010-composition-request-pipeline-and-diagnostics-tracing.md. The pipeline's own internal stages still communicate via Compono.CompositionResult, not exceptions - only this outward-facing boundary throws.
| Constructors | |
|---|---|
| CompositionException(CompositionDiagnostic) | Creates a CompositionException from a structured CompositionDiagnostic - the shape every pipeline-thrown instance uses, per docs/public-api.md's Diagnostics API. |
| CompositionException(CompositionDiagnostic, Exception) | Creates a CompositionException from a structured CompositionDiagnostic, preserving innerException - the shape a configured IServiceProvider throwing during stage 3's fallback sub-step uses, per docs/adr/0019-registrations-and-service-provider-injection.md ("never throw ex;, the original exception is always preserved"). |
| CompositionException(string) | Creates a CompositionException with no structured Diagnostic. |
| Properties | |
|---|---|
| Diagnostic | The structured detail behind this failure, or null if this instance was constructed from a plain message. |
| Methods | |
|---|---|
| WithSeedInMessage(CompositionException, int) | 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). |