Architecture Decision Record
ADR-013: Result Pattern over Exceptions for Flow Control
Status
Accepted. Revised 2026-07-21 (exception-handler chain / ProblemDetails edge contract documented).
Revised 2026-08-26 (ErrorType.Unexpected, severity-ranked status selection for aggregated
failures, and the full combinator surface).
Revised 2026-08-27 (v1.164.0): the UI layer deviation is retired. MMCA.Common.UI services
return Result end to end instead of throwing, the severity ranking is hoisted into
MMCA.Common.Shared so the HTTP and gRPC edges classify one aggregate identically, and the round
trip back into Result is a shipped reader rather than a per-service convention.
Revised 2026-08-31: the catch-all exception handler now maps CrossTenantWriteException to HTTP 400
ahead of its 500 fallback, so a write refused at the tenant boundary reads as a caller fault.
Revised 2026-09-03: the error Code is gated as a per-repo public vocabulary (one literal code, one
owning type) by an IL-reading architecture rule.
Revised 2026-10-01: citations re-anchored after line shifts; no decision changed.
Revised 2026-10-06: ErrorType.TooManyRequests (HTTP 429, gRPC ResourceExhausted, severity rank
45) joins the category set, the catch-all exception handler also answers BadHttpRequestException
with the status it carries (413 for an oversize body), and the UI executor counts Polly's ExecutionRejectedException as a
transport fault.
Revised 2026-10-07: a client-synthesized failure is localized by its code through the caller's
localizer and, when the caller passes one, then the framework's own SharedResource pair before
falling back to English, and the error-catalog rule's own summary now states that it does not read
Error.TooManyRequests; anchors refreshed after the v1.232.1 release.
Revised 2026-10-21: the error-catalog rule now recognizes Error.TooManyRequests (v1.247.0), so
codes built through it are held to the uniqueness and prefix gates; the 499 handler also answers a
DbException raised after the client disconnects (v1.241.0); anchors refreshed.
Revised 2026-10-26: TryGetValue is an instance member of Result<T> (v1.252.0) and the page-side
extension keeps only the overload that hands the errors back, which decides on a non-null success
value; the 409 handler's concurrency metric is recorded; anchors refreshed.
Revised 2026-10-28: the code-based localization lookup is scoped to the three code kinds it covers
(Http.EmptyResponse and Http.MalformedResponse render in English), the reader's own handling of
an unreadable body ahead of the executor is recorded, and the Result channel is no longer said to
carry requestId.
Revised 2026-11-23: an Error carries an optional RetryAfter and HandleFailure answers a 429
with a Retry-After header from the longest hint (v1.295.0), a value that is not projected into the
errors array; anchors refreshed.
Revised 2026-11-24: the error-catalog IL scan reads method bodies through the testing package's own
metadata reader rather than Mono.Cecil (MMCA.Common 1.318.0, ADR-015
Amendment (2026-11-24)); the Decision's wording is corrected in place.
Revised 2026-11-30 (v1.323.0): ErrorType.Failure is removed and ErrorType.Unavailable (HTTP 503)
names a dependency that failed or did not answer in time, the member values are pinned, the unused
railway helpers are removed, Result cannot be constructed outside its assembly, and the never-thrown
domain exceptions and their handler are deleted; the Decision is corrected in place (see Revision below).
Revised 2026-12-05 (v1.335.0): the error catalog reads every module layer except UI (Domain,
Application, Shared, API and Infrastructure), and Helpdesk runs it; corrected in place in the catalog
section.
Context
Operations at every layer fail in expected ways: input is invalid, a domain invariant is broken, a requested entity is missing, a uniqueness conflict occurs, the caller lacks permission. There are two common ways to signal those: throw an exception and translate it near the edge, or return an explicit value that the caller must inspect. Using exceptions for expected business outcomes has real costs: the failure is invisible in the method signature, it is easy to forget to catch, it is comparatively expensive on the throw path, and it conflates "the user asked for something we will not do" with "the process is broken."
Decision
Model expected failures as values using Result / Result<T> (MMCA.Common.Shared.Abstractions),
not exceptions.
A
Resultis either success or failure; a failure carries one or moreErrorrecords (Code,Message,Typeof typeErrorType, optionalSource/Target, and an init-onlyTimeSpan? RetryAfteraTooManyRequestsorUnavailableproducer sets when it knows how long the refusal lasts,MMCA.Common/Source/Core/MMCA.Common.Shared/Abstractions/Error.cs:31-38; the sign-in lockout sets it,MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Auth/LoginProtectionService.cs:107).ErrorTypeis a transport-agnostic category:Validation,Invariant,NotFound,Conflict,Unauthorized,Forbidden,UnprocessableEntity,Unexpected,TooManyRequests,Unavailable. The domain never names an HTTP status, and there is no unclassified member: every error names a meaning,Validation,InvariantorUnprocessableEntitywhen the caller can fix the request,Unavailablewhen retrying later can succeed, andUnexpectedwhen neither holds (MMCA.Common/Source/Core/MMCA.Common.Shared/Abstractions/ErrorType.cs:13-16).Unexpectedis the genuine server-side fault (the request was well formed and permitted, the server could not complete it, and retrying will not cure it,ErrorType.cs:47-53): it maps to HTTP 500 (MMCA.Common/Source/Presentation/MMCA.Common.API/Middleware/ErrorHttpMapping.cs:32) and to gRPCInternal(MMCA.Common/Source/Presentation/MMCA.Common.Grpc/ResultGrpcExtensions.cs:48), and it is explicitly not for business-rule violations (ErrorType.cs:49-51, factory at.../Shared/Abstractions/Error.cs:140-141, whose summary sends a failed or timed-out dependency toUnavailable,:131-133).TooManyRequestsis the temporary refusal (a login or password-change lockout): it maps to HTTP 429 (ErrorHttpMapping.cs:33) and gRPCResourceExhausted(ResultGrpcExtensions.cs:49), and the caller fixes it by retrying later rather than by changing the request (ErrorType.cs:55-59, factory atError.cs:112-113).Unavailableis a dependency that failed or did not answer in time (a storage or push provider, a remote service, an expired request budget): the request was fine and retrying later can succeed, so it maps to HTTP 503 (ErrorHttpMapping.cs:34) and gRPCUnavailable(ResultGrpcExtensions.cs:50) (ErrorType.cs:61-67, factory atError.cs:125-126). The numeric values are pinned explicitly (Unexpected = 8,TooManyRequests = 9,Unavailable = 10,ErrorType.cs:53,:59,:67) and 7 is retired (:16-18), so no in-process or persisted value moves; both wire forms carry the member name (ErrorHttpMapping.cs:70,ResultGrpcExtensions.cs:138).Domain factory methods and mutators return
Result<T>; application command/query handlers thread results through the combinators or an early return instead oftry/catch. The surface is:- Lifting without naming a factory. An
Errorconverts implicitly to a failedResult(.../Shared/Abstractions/Result.cs:50) orResult<T>(:242-246), and a value converts implicitly to a successfulResult<T>(:258), so a guard clause writesreturn someError;and a happy path writesreturn theValue;.Result.FromErroris the named alternate for the non-generic conversion (:56-60); the inheritedResult.Failure<T>/Result.Success<T>factories are the named alternates on the generic type (:108,:75). - On
Result<T>:Match(:269-277), exactly one branch running;Map(:285-289),Bind(:311-315) andBindAsync(:298-302).TryGetValueunwraps the value inside a conditional the wayDictionary.TryGetValuedoes, deciding onIsFailurerather than on the value so a value-type default is not mistaken for success (:206-216, the check at:208); a multi-step handler unwraps each step this way and returns early on failure. - On the non-generic
Result:Match(:162-168) andBind(:176-180), so a valueless step composes the same way instead of forcing anIsFailurecheck, andCombineaggregates several results into one (:131-152). - There are no combinators over a pending
Task<Result<T>>and no side-effect or predicate combinators: an asynchronous step is awaited, then unwrapped or bound. - Every combinator short-circuits: a failed result never invokes the delegate it was handed
(
Result.cs:179,:288,:301,:314).
- Lifting without naming a factory. An
The transport mapping lives only at the edge.
ApiControllerBase.HandleFailure()(MMCA.Common/Source/Presentation/MMCA.Common.API/Controllers/ApiControllerBase.cs:50-78) maps anErrorTypeto an HTTP status through aFrozenDictionary(ErrorHttpMapping.cs:23-35, resolved atApiControllerBase.cs:63) and returns an RFC 9457 ProblemDetails body carrying all errors (:65-73, projection atErrorHttpMapping.cs:65-74). A 429 whoseTooManyRequestserrors, or a 503 whoseUnavailableerrors, carry aRetryAfteralso gets aRetry-Afterheader, the longest hint winning, in the whole rounded-up seconds the rate limiters send (ApiControllerBase.cs:75,SetRetryAfterat:89-112, the hinted type chosen by status at:92-103, the header written at:110only for a positive hint,:108); any other status, or a 429 or 503 with no positive hint, sends none.RetryAfteris not projected into theerrorsarray (ErrorHttpMapping.cs:65-74), so it travels only as that header and does not round-trip throughProblemDetailsResultReader. gRPC does the equivalent over the wire (GrpcResultExceptionInterceptor, ADR-007) from a mirrored table (Validation/InvarianttoInvalidArgument,NotFoundtoNotFound,ConflicttoAborted,UnauthorizedtoUnauthenticated,ForbiddentoPermissionDenied,UnprocessableEntitytoFailedPrecondition,UnexpectedtoInternal,TooManyRequeststoResourceExhausted,UnavailabletoUnavailable:ResultGrpcExtensions.cs:41-50), so callers keep programming againstResult<T>across a process boundary.A failure carrying several errors takes the status of the most severe one, never of the first, and both edges rank it the same way.
Result.Combineaggregates errors in evaluation order (Result.cs:131-152), so a positional rule let an incidental validation failure downgrade a real 403 or 500 to a 400. The ranking is one table in the Shared layer,ErrorTypeSeverity(MMCA.Common/Source/Core/MMCA.Common.Shared/Abstractions/ErrorTypeSeverity.cs:32), most to least severe:Unexpected(70) >Unavailable(65) >Unauthorized(60) >Forbidden(50) >TooManyRequests(45) >Conflict(40) >NotFound(30) >UnprocessableEntity(20) >Invariant/Validation(one shared rank of 10,:39-51), with the reasoning for each rank written onto the type itself (:16-27; a lockout outranks a conflict because the caller is refused whatever the request says,:22).MostSeverekeeps the earliest error on a tie (:72-99, strict>at:91) and an unmapped category ranks lowest, so a category added toErrorTypewithout a rank can never silently outrank a real 403 or 500 (:60, stated at:53-57). The scan is index-based rather than a LINQMaxBybecause it runs on every failure response (:86-87).It lives in Shared rather than in one presentation package because two edges consume it. HTTP resolves the status from
ErrorTypeSeverity.MostSevere(.../MMCA.Common.API/Middleware/ErrorHttpMapping.cs:54-55, called fromApiControllerBase.HandleFailureatApiControllerBase.cs:63) and gRPC'sToRpcExceptiondoes the same (.../MMCA.Common.Grpc/ResultGrpcExtensions.cs:125, inToRpcExceptionat:120, argued in its summary from:104). Only the status is ranked: every error still travels in the ProblemDetailserrorsarray (ErrorHttpMapping.cs:65-74) and in the gRPC trailers aserror-{i}-code/-message/-type(ResultGrpcExtensions.cs:136-138). Ranking in one place is what makes the two transports agree; the previous arrangement, with the table insideMMCA.Common.API, left gRPC classifying an aggregate by its first error while HTTP classified it by its worst.Exceptions are reserved for the genuinely exceptional: programming errors (null-argument guards) and infrastructure faults (DB / transaction failures) that should abort the request rather than be modeled as a business outcome.
When an exception does escape to the HTTP edge, the API layer converges it onto the same RFC 9457 ProblemDetails shape via an ordered
IExceptionHandlerchain, so both channels (Result and exception) return one wire contract.AddCommonExceptionHandlers()first registersAddProblemDetails(which stamps arequestIdextension from the request's trace identifier), then registers the handlers in a load-bearing order; ASP.NET Core runs them in registration order and stops at the first handler that reports the exception handled, so most-specific-first placement is the mechanism, not a comment (MMCA.Common/Source/Presentation/MMCA.Common.API/DependencyInjection.cs:157-168, registrations at lines 162-165):OperationCanceledExceptionHandler(registered first) maps a client-disconnectOperationCanceledExceptionto the non-standard HTTP 499 Client Closed Request, so monitoring can tell an abandoned request apart from a server fault (MMCA.Common/Source/Presentation/MMCA.Common.API/Middleware/OperationCanceledExceptionHandler.cs:38-39, status set at:46). It answers aDbExceptionraised after the client has gone the same way, because a data provider may report the cancelled command as its own exception (SqlClient raises aSqlException); it is still logged with its stack at warning, and any other exception type, or aDbExceptionwhile the client is connected, falls through to the generic handler (:17-22).DbUpdateExceptionHandlermaps an EF CoreDbUpdateException(concurrency, unique-constraint, or foreign-key failure) to HTTP 409 Conflict, returning a generic detail so no database schema detail leaks to the client; the full exception is logged at error, and a concurrency conflict (only that kind) is also counted in a metric (MMCA.Common/Source/Presentation/MMCA.Common.API/Middleware/DbUpdateExceptionHandler.cs:29,32,41,45, the metric at:36-39).ValidationExceptionHandlermaps a FluentValidationValidationExceptionto HTTP 400, grouping the failures by property name into anerrorsextension that matches ASP.NET Core's model-validation shape (MMCA.Common/Source/Presentation/MMCA.Common.API/Middleware/ValidationExceptionHandler.cs:28,33,48-54).GlobalExceptionHandler(registered last) is the catch-all that turns any remaining unhandled exception into HTTP 500 (MMCA.Common/Source/Presentation/MMCA.Common.API/Middleware/GlobalExceptionHandler.cs:100-113, status set at:102). It maps two exceptions by type before that fallback, both caller faults rather than server faults and both logged at warning rather than error. ACrossTenantWriteException(the save-time tenant-boundary rejection,.../MMCA.Common.Infrastructure/Persistence/Interceptors/CrossTenantWriteException.cs:24) is answered with HTTP 400, because a tenant-scoped API refusing an untenanted write is routine (:54-72, the warning at:58, the 400 at:60). The special case sits inside the catch-all rather than in its own handler because the exception derives fromInvalidOperationException, so no handler ahead of this one claims it, and every other save-time invariant failure of that family still ends at the 500 (:14-19). The response body names no tenant id and no entity type: echoing either would tell an unauthorized caller which tenant owns the row it just tried to write, so the detail is a fixed string and the full failure stays in the log (:38-46). ABadHttpRequestException(a body over the endpoint's request size limit, or an unreadable request) is answered with the status the exception itself carries, passed through unchanged (:82,:89): a 413 gets a "Payload Too Large" title and detail, and any other status (400 for an unreadable request, or another client status Kestrel assigns) gets the fixed "Bad Request" pair (:74-98, the title and detail at:90-95).
The client half: the UI layer returns Result too (2026-08-27)
Until v1.164.0 this record held everywhere except the one layer a user actually sees. A UI service
called the API, pulled the domain wording out of the ProblemDetails body, and rethrew it as a
DomainInvariantViolationException for the page to catch: the pattern was inverted at the last hop,
and every page paid for it with a try/catch around a call whose failure was entirely expected.
That deviation is retired. Every HTTP-typed client service in MMCA.Common.UI now returns
Result / Result<T>, and ServiceExceptionHelper is deleted rather than deprecated.
Two halves make a service method honestly typed, and they are deliberately separate types:
ProblemDetailsResultReaderconverts a response. (MMCA.Common/Source/Core/MMCA.Common.Shared/Http/ProblemDetailsResultReader.cs:58.) It is the exact reverse ofApiControllerBase.HandleFailure:ReadAsync(response, ct)answers a valuelessResult(:253) andReadAsync<T>(response, options, ct)deserializes a 2xx body or parses the failure (:288), with the pureParseProblemDetails(status, body)core testable against captured payloads (:155). It understands four payload shapes (:20-49): the MMCA error array, wherecode,message,type,sourceandtargetall round-trip andtypeparses straight back intoErrorType(:350-385, the type read at:377, the parse at:434-439); the ASP.NET Core validation dictionary, which yields one error per message codedValidation.{property}(orValidationfor an empty key) with the category taken from the status (:387-432, the code at:394-396); plain ProblemDetails with noerrorsextension; and a non-JSON or empty body. Each of the last two synthesizes one error codedHttp.{status}(:157-178,:203, built at:441-445, the code at:502-503). Property lookup is case-insensitive on purpose, because a hand-built PascalCase payload would otherwise silently lose every field (:469-500). It lives inMMCA.Common.Sharedand uses nothing beyond the BCL, because the consumer isMMCA.Common.UI, which references Shared only (:14-19).HttpResultExecutorconverts the absence of one. (.../MMCA.Common.UI/Services/Api/HttpResultExecutor.cs:35.) It does not make the request: it takes the caller's whole send-and-read operation as aFunc<Task<Result>>/Func<Task<Result<T>>>and wraps it (:56,:91), so the two halves compose without either knowing the other's shape. A refused connection, a DNS failure, a dropped socket, an unreadable body (HttpRequestException,IOException,JsonException), or a call the client's resilience pipeline refused to run or finish (Polly'sExecutionRejectedException, the base ofTimeoutRejectedExceptionandBrokenCircuitException) becomes a failedResultcodedHttp.TransportFailure(the fault set at:118-128, caught at:77,:112, built at:130-133, code at:38). AnHttpClienttimeout, which surfaces as anOperationCanceledExceptionwith the caller's token not cancelled, becomesHttp.Timeout(:135-136, code at:41); a timeout raised by a Polly strategy instead arrives as aTimeoutRejectedExceptionand is classed with the transport faults. Both are built asError.Unexpected(:133,:136). Anything else is a genuine programming fault and keeps travelling as an exception (:124-125). The exception's own text goes onError.Source, never onMessage, because it is diagnostic detail that is neither localizable nor safe to render (:130-133). The executor only sees the faults the wrapped operation lets escape: when that operation reads throughProblemDetailsResultReader, the reader catches a body-readHttpRequestExceptionitself and falls back to the status-only result (ProblemDetailsResultReader.cs:338-347), which for the typedReadAsync<T>on a 2xx is a failure codedHttp.EmptyResponse(:296,:303-310; the valuelessReadAsyncreturns success on a 2xx without reading the body,:259-262), and it catches aJsonExceptionon a 2xx body asHttp.MalformedResponse(:323-326). That last failure carries theJsonExceptiontext onMessage, not onSource(:325), so the reader does not follow the executor's rule, and the page-side lookup below renders that text as the message.
OperationCanceledException is the one exception that still crosses the boundary, and that is the
decision, not an omission. When the caller's own token is why the operation stopped, the
cancellation is rethrown (HttpResultExecutor.cs:69-72, :104-107, argued at :18-24): a disposed
component or a superseded grid fetch owns its own cancellation and must not have it handed back as
an error to render. A client timeout raises the same exception type with the token not cancelled,
and that one does become a failure (:73-76, :108-111). The token is also checked before the
call, so an already-abandoned request never reaches the network (:63, :98).
Pages branch; they do not catch. ResultUiExtensions
(.../MMCA.Common.UI/Common/ResultUiExtensions.cs:74) is the page-side idiom, written once so no
page hand-rolls it. A page unwraps with the instance Result<T>.TryGetValue (Result.cs:218-228);
the one TryGetValue left here is the overload that also hands the errors back on the failing
branch (ResultUiExtensions.cs:103-120). That overload decides on IsSuccess and a non-null
value (:110), so a success carrying a null value takes its failing branch with an empty error
list (stated at :90-95), where the instance method returns true because it decides on
IsFailure alone (Result.cs:220-227). Back in ResultUiExtensions.cs, OnFailureSetError
pushes the composed message into a page field (:214, :226) and NotifyOnFailure raises it as exactly one snackbar, never one per
error (:255, :276); and HasErrorType with IsNotFound / IsUnauthorized lets a page turn a
404 into an empty state and a 401 into a redirect instead of an alert (:294-298, :306, :314).
Messages are localized as resource keys with pass-through, so one call site handles both an API
error the server already translated and a client-side error whose Message is a key (:23-27,
Localize at :373-382, ADR-027). Three kinds of client-synthesized failure have no
server-phrased message to pass through, so they are looked up by their error code instead: a
bodiless Http.{status} (recognized through ProblemDetailsResultReader.TryGetSynthesizedStatus,
:326), then the generic Http.Status format, plus Http.TransportFailure and Http.Timeout
(:27-33, LocalizeError at :316-339, the transport check at :333). The reader's other two
synthesized codes, Http.EmptyResponse and Http.MalformedResponse
(ProblemDetailsResultReader.cs:71, :77), are not in that lookup: they fall through to the
message pass-through (ResultUiExtensions.cs:338), and SharedResource.resx holds no key for
either (it carries Http.Status, the Http.{status} sentences, Http.TransportFailure and
Http.Timeout, .../MMCA.Common.UI/Resources/SharedResource.resx:844, :847-877, :880, :883), so they
render their English message. Each code resolves through the localizer the page passed
and then, when that localizer has no such key, through the framework's own SharedResource pair
for the current UI culture, so a page passing its own IStringLocalizer<PageType> still shows the
translated sentence; the English message is the last resort (:30-33, the two-step lookup at
:343-349 and :352-362). The lookup runs only when a localizer is passed: OnFailureSetError
and NotifyOnFailure default it to null (:214, :226, :258, :279), and with none
LocalizeError returns the raw English message without consulting SharedResource (:318-321).
A transport or timeout code is replaced only while it still carries the executor's own English
sentence, so a caller that reused the code with a message of its own keeps that message
(:366-371). The messages are deduplicated and ordered by the same ErrorTypeSeverity rank the
edges use, so a real 403 leads and an incidental validation message never buries it (:132-146,
the ordering at :142, the deduplication at :145). The shared ErrorSummary component
renders the same list as one deduplicating MudAlert, taking a failed Result and the
MudForm.Errors shape together and rendering nothing at all when there is nothing to say
(.../MMCA.Common.UI/Components/Forms/ErrorSummary.razor:8, both shapes merged at :87-105, one message
inline and several as a list so a screen reader announces them as several items, :17-31).
A component that shows a retry needs the failure, not an exception.
MobileInfiniteScrollList takes one page fetcher, FetchPageResult, a required delegate returning
Task<Result<(IReadOnlyList<TItem> Items, int TotalItems)>>
(.../MMCA.Common.UI/Components/Lists/MobileInfiniteScrollList.razor.cs:47), and renders the failure's
localized message beside its inline retry affordance (:187-193 into SetLoadFailed at :191, the
message read from the failed Result at :289). A tuple-returning delegate is not offered beside it: a tuple has no way to carry
a failure at all, so the component would be left showing a Retry button that cannot name what it is
retrying. The delegate is checked at initialization, so a call site that omits it throws instead of
rendering as a load failure that can never succeed (:104-116, the guard at :111, the throw at
:113-114).
The error Code is a public vocabulary, gated for uniqueness (2026-09-03)
Code is the half of a failure that crosses the wire verbatim (ErrorHttpMapping.cs:65-74) and the
key ADR-027 localizes the message by, so a client switches on Order.NotFound and a support ticket
quotes it. Two modules that both ship Item.Invalid make that vocabulary ambiguous, and the
ambiguity only surfaces in production
(MMCA.Common/Source/Hosting/MMCA.Common.Testing.Architecture/Rules/Contracts/ArchitectureRules.ErrorCatalog.cs:54-59).
The catalog is therefore frozen the way ADR-010 froze integration-event schemas and ADR-015 Section B
froze the .proto contracts. An IL scan (the testing package's own metadata reader) reads the Error factory call sites it
recognizes (CollectErrorCodesIn at :226, IsErrorFactory at :285-287, the recognized members at
:39-52) across every module layer of the map except UI: the per-module Domain, Application, Shared,
API and Infrastructure assemblies (:30-31, the reason at :25-28), because a shared value type, a
controller, an MCP reader or an infrastructure adapter hands its code to a client exactly as a handler
does (since MMCA.Common v1.335.0, MMCA.Common/CHANGELOG.md:15). The recognized set covers every
code-first factory, Error.TooManyRequests included (ArchitectureRules.ErrorCatalog.cs:48, the factory at Error.cs:112-113),
plus the primary constructor (ArchitectureRules.ErrorCatalog.cs:51, described at :33-38);
ErrorCodesAreUnique (:92) fails the build when one literal code is constructed by more than one
declaring type (:101-102), and ErrorCodesUseAnAllowedPrefix (:132) requires the owning prefix. A
code built at run time is reported as UNVERIFIABLE rather than passed or failed (:181-184,
:299). Consumers subclass
ErrorCatalogTestsBase (.../Bases/Contracts/ErrorCatalogTestsBase.cs:26, the three facts at :52,
:56, :60) and allowlist a deliberately shared code (:41-42) rather than rename a shipped one:
Store (MMCA.Store/Tests/Architecture/MMCA.Store.Architecture.Tests/Contracts/ErrorCatalogTests.cs:19),
ADC (MMCA.ADC/Tests/Architecture/MMCA.ADC.Architecture.Tests/Contracts/ErrorCatalogTests.cs:20) and
Helpdesk (MMCA.Helpdesk/Tests/Architecture/MMCA.Helpdesk.Architecture.Tests/Governance/ErrorCatalogTests.cs:24)
do; MMCA.Common ships no module catalog and self-tests the rules against fixtures instead
(MMCA.Common/Tests/Architecture/MMCA.Common.Architecture.Tests/Contracts/ErrorCatalogFitnessTests.cs:16).
Rationale
- Failures are in the signature. A method that can fail returns
Result<T>, so the caller cannot silently ignore the failure path the way an uncaught exception allows. - Category, not status code, at the core.
ErrorTypekeeps Domain and Application transport- agnostic; only the API (or gRPC interceptor) translates it, so the same handler serves REST and gRPC. - Composable. The railway-oriented combinators chain steps without an
IsFailurecheck at every line, and short-circuit on the first failure. The implicit conversions are what keep the ceremony proportional: a guard clause returns theErroritself (Result.cs:50), so the cheapest thing to write is also the correct one. - An aggregate answers with its worst problem. Ranking the categories makes the status independent
of the order invariants happen to be evaluated in, which is the one thing a caller cannot see and
the one thing
Result.Combinemakes arbitrary (ErrorHttpMapping.cs:44-51, restated on the enum itself atErrorType.cs:5-11). - Cheap and predictable. No throw/catch on the common "won't do it" path.
- One wire contract for both channels. Whether a request ends in a
Result.Failuremapped byHandleFailure()or an escaped exception caught by the handler chain, the client receives an RFC 9457 ProblemDetails body, so consumers parse one error shape regardless of which channel produced it. The sharedrequestIdextension is stamped by theAddProblemDetailscustomization (DependencyInjection.cs:159-161); on a non-empty error listHandleFailurebuilds its body directly and returns it throughStatusCode(...)(ApiControllerBase.cs:65-77), and the shared conformance base accepts either anerrorslist or a correlation id on that body (MMCA.Common/Source/Hosting/MMCA.Common.Testing/Conformance/ProblemDetailsContractTestsBase.cs:76-80), so no test pinsrequestIdon the Result channel. - The layer with the most expected failures had the least Result. A UI service call fails for
every reason this record was written about: the input was rejected, the record is gone, the caller
signed out. Converting the response back into an exception at the last hop meant the one layer
whose whole job is rendering failure was the one layer that had to catch, and it made a
business-rule violation and a dropped socket arrive the same way. Returning
Resultthere closes the round trip: the category the domain produced is the category the page branches on. - Ranking in Shared rather than at each edge is what makes "the same aggregate" mean something. A ranking table copied into two presentation packages is two tables, and the gRPC edge proved it by classifying by position while HTTP classified by severity. One table in the layer both edges already reference removes the possibility rather than the habit.
Trade-offs
- More ceremony at call sites than letting an exception bubble; the combinators absorb most of it.
- Two error channels coexist (Result for expected, exceptions for exceptional). The boundary is a
judgment call: "could a well-behaved caller reasonably trigger this?" then return a
Result, otherwise throw. - One status still has to stand for a whole list. Severity ranking removes the ordering dependency
but not the collapse: a failure carrying a 403 and a 400 answers 403, and the 400 is visible only
to a client that reads the
errorsarray (ErrorHttpMapping.cs:65-74). The two 400-mapped categories share one rank (ErrorTypeSeverity.cs:49-50), so among them the earliest error still wins. - The reverse mapping is lossy on 400, and only between
ValidationandInvariant. A client reading an MMCA error array gets the originalErrorTypeverbatim, because the edge writesTypeas a field (ErrorHttpMapping.cs:65-74, the name at:70) and the reader parses it back (ProblemDetailsResultReader.cs:380,:437-439). Every other payload shape (a validation dictionary, a plain ProblemDetails, a non-JSON body) has to derive the category from the status code, and the forward map sendsValidationandInvariantboth to 400, so the reverse can only pick one: it picksValidation(:97-109, which also maps 503 back toUnavailableat:101and 429 toTooManyRequestsat:107, and reads any other 4xx asValidationand any other status asUnexpected,:140; admitted twice at:50-57and:126-129, pinned byMMCA.Common/Tests/Core/MMCA.Common.Shared.Tests/Http/ProblemDetailsResultReaderTests.cs:238). A client that needsInvariantdistinguished fromValidationmust call an endpoint that emits the error array, which everyApiControllerBasefailure does but an escaped exception handled by the handler chain does not. - The UI's Result surface is a breaking change for every consumer page. Retiring the deviation
moved
MMCA.Common.UI's public API by 41 removals and 98 additions in one release, so every page that wrapped a service call intry/catchhad to be rewritten to branch. That is the cost of having deferred the conversion: the deviation was cheap to keep and expensive to remove, and it grew with every page added while it stood. - An exception reaching a page still costs it the reason. Where a failed
Resultcarries a localized message the page can render, an exception that escapes a consumer-supplied fetcher falls back to a generic resource string, because its own text is neither translatable nor safe to render (MobileInfiniteScrollList.razor.cs:210-219,SetLoadFailed(failure: null)at:218, the fallback stated at:281-285,SetLoadFaileditself at:286-290). ReturningResultis what makes the specific message available at all; nothing forces a call site to produce one. - The exception-handler registration order is load-bearing. Because ASP.NET Core stops at the first
handler that reports the exception handled, a mis-ordered registration (for example the catch-all
GlobalExceptionHandlerahead of a specific handler) would swallow the more precise status;GlobalExceptionHandlermust stay registered last (MMCA.Common/Source/Presentation/MMCA.Common.API/DependencyInjection.cs:162-165).
Revision (2026-10-01)
No decision or rationale changed. Citations were re-anchored to the current source after line
shifts: the gRPC status table, ToRpcException ranking and trailer writes in
ResultGrpcExtensions.cs (:36-48, :121-123, :133-135); AddCommonExceptionHandlers
(DependencyInjection.cs:149-161, registrations :154-158) and the 499 handler
(OperationCanceledExceptionHandler.cs:29-30,37); the ProblemDetailsResultReader members; the
ResultUiExtensions page helpers; the ErrorSummary merge and list rendering; and
MobileInfiniteScrollList, whose failure path now runs through SetLoadFailed
(MobileInfiniteScrollList.razor.cs:278-282).
Revision (2026-10-06)
The decision is unchanged; additive behavior that had shipped without being recorded is now described:
ErrorTypehas ten categories:TooManyRequests(a lockout) maps to HTTP 429 (ErrorHttpMapping.cs:31), gRPCResourceExhausted(ResultGrpcExtensions.cs:49), severity rank 45 betweenForbiddenandConflict(ErrorTypeSeverity.cs:43), and back from 429 in the reader (ProblemDetailsResultReader.cs:105).GlobalExceptionHandlermaps two exceptions by type, not one:BadHttpRequestExceptionis answered with the status it carries, at warning level, titled "Payload Too Large" for a 413 and "Bad Request" for any other status (GlobalExceptionHandler.cs:72-95, the status at:79,:86).HttpResultExecutoralso treats Polly'sExecutionRejectedExceptionas a transport fault (HttpResultExecutor.cs:125-126), so a resilience-pipeline timeout reads asHttp.TransportFailure; only anHttpClienttimeout reads asHttp.Timeout.- Corrected: the validation dictionary yields
Validation.{property}codes, one per message.Http.{status}is the fallback code wherever no code is supplied: a plain ProblemDetails, a non-JSON or non-object body, anerrorsextension that parses to nothing (ProblemDetailsResultReader.cs:178,:197-203), and an MMCA array entry that is a bare string or an object with nocode(:366,:380). - Added: client-synthesized failures are localized by error code (
ResultUiExtensions.cs:339-365). - Corrected:
TapAsyncandMatchAsyncdo not delegate to the instance combinator of the same name, though they short-circuit identically (ResultExtensions.cs:84-90,:111-112). - Noted: the error-catalog IL scan does not recognize
Error.TooManyRequests(ArchitectureRules.ErrorCatalog.cs:17-29). - All live-section anchors were re-verified against current source. The 2026-10-01 anchors for the
gRPC table and trailers now read
ResultGrpcExtensions.cs:37-50,:123-125,:135-137, and theSetLoadFailedfailure pathMobileInfiniteScrollList.razor.cs:301-305.
Revision (2026-10-07)
Re-verified against current source. The decision, the combinator surface, the ten categories, the
severity ranking, the exception-handler chain and the executor's fault classification are unchanged;
one behavior was added, one description moved, and most anchors into six files shifted with the
v1.232.1 release (HttpResultExecutor.cs:18-24 and ErrorSummary.razor:8 / :17-31 did not move).
- Added: a client-synthesized failure (
Http.{status},Http.Status,Http.TransportFailure,Http.Timeout) resolves through the page's localizer and then through the framework's ownSharedResourcepair for the current UI culture, with the English message only as the last resort, and a transport or timeout code is replaced only while it still carries the executor's own English sentence (ResultUiExtensions.cs:30-33,:377-383,:386-397,:398-405). The lookup runs only when a localizer is passed; with none,LocalizeErrorreturns the English message unchanged (:352-355, the null defaults at:248,:260,:292,:313). - Corrected: the error-catalog rule's summary states that its recognized list omits
Error.TooManyRequests(ArchitectureRules.ErrorCatalog.cs:11-15); the gap itself is unchanged (:19-31,Error.cs:103). - Anchors re-verified against current source:
ResultExtensions.cs:14,:24-33,:43-52,:62-71,:81-95,:89-92,:106-117,:115-116;GlobalExceptionHandler.cs:14-19,:38-46,:54-72(:58,:60),:74-98(:82,:89,:90-95),:100-113(:102);HttpResultExecutor.cs:35,:38,:41,:56,:63,:69-72,:73-76,:77,:91,:98,:104-107,:108-111,:112,:118-128(the fault set, withExecutionRejectedExceptionat:128),:124-125,:130-133,:135-136;ResultUiExtensions.cs:23-27,:74,:103-118,:110-114,:137,:166-180,:248,:260,:289,:310,:328-332,:340,:348,:350-373,:407-416;ErrorSummary.razor:87-105;ArchitectureRules.ErrorCatalog.cs:33-39,:64,:75,:104,:149-157,:171,:185-191,:207-208,:212-215,:219-224. The 2026-10-06 entry above keeps its anchors as written; itsResultExtensions.cs:84-90/:111-112,GlobalExceptionHandler.cs:72-95/:79/:86,HttpResultExecutor.cs:125-126,ResultUiExtensions.cs:339-365andArchitectureRules.ErrorCatalog.cs:17-29now read:89-92/:115-116,:74-98/:82/:89,:127-128,:350-373and:19-31. Spot checks foundErrorHttpMapping.cs:30-31,ResultGrpcExtensions.cs:48-49,ErrorTypeSeverity.cs:43,Error.cs:103and:126-127, andMobileInfiniteScrollList.razor.cs:301-305still correct.
Revision (2026-10-21)
Re-verified against current source. The decision, the combinator surface, the ten categories, the
severity ranking, the exception-handler order, and the MobileInfiniteScrollList failure behavior
are unchanged; one gap recorded by the earlier revisions is closed, the 499 handler claims one more
exception type, and anchors into four files moved.
- Changed: the error-catalog IL scan now recognizes
Error.TooManyRequests(ArchitectureRules.ErrorCatalog.cs:26, in the recognized list at:17-30), so a code built through that factory is checked for uniqueness and prefix like any other, and the list's summary no longer states a gap (:11-16). Shipped in v1.247.0 (MMCA.Common/CHANGELOG.md:93). The 2026-10-06 "Noted" item and 2026-10-07 item 2 above describe the earlier state. - Moved:
SetLoadFailed, atMobileInfiniteScrollList.razor.cs:301-305when the 2026-10-07 spot check ran, has since moved (v1.234.1); those lines are nowResetAsynccode, andSetLoadFailedsits at:266-270. - Changed:
OperationCanceledExceptionHandleralso answers 499 for aDbExceptionraised after the client disconnects, since a data provider may report the cancelled command as its own exception; it is logged at warning with its stack, and aDbExceptionwhile the client is connected still falls through to the 500 (OperationCanceledExceptionHandler.cs:17-22, the type and disconnect guard at:38-39, the 499 at:46). Shipped in v1.241.0 (MMCA.Common/CHANGELOG.md:230). - Anchors re-verified against current source:
DependencyInjection.cs:154-166(AddProblemDetailsat:156-158, registrations:159-163,GlobalExceptionHandlerlast at:163);OperationCanceledExceptionHandler.cs:17-22,:38-39,:46;MobileInfiniteScrollList.razor.cs:37,:94-106(guard at:101, throw at:103-104),:169-175(:173),:191-199(:198),:261-264,:266-270(:269);ArchitectureRules.ErrorCatalog.cs:32-38,:63,:74,:103,:148-156,:170,:184-190,:206-207,:211-214,:218-223;Error.cs:103-104.
Revision (2026-10-26)
Re-verified against current source. The decision, the ten categories, the severity ranking, the
exception-handler order and the localization behavior are unchanged; v1.252.0 moved the unwrap
idiom onto Result<T> itself, which shifted every generic Result.cs anchor, and anchors into
ResultUiExtensions.cs and DbUpdateExceptionHandler.cs moved.
- Changed:
TryGetValueis now the instance methodResult<T>.TryGetValue, deciding onIsFailure(MMCA.Common/Source/Core/MMCA.Common.Shared/Abstractions/Result.cs:218-228, the check at:220); the one-argumentResultUiExtensions.TryGetValueis removed (MMCA.Common/CHANGELOG.md:201). The remainingResultUiExtensions.TryGetValueoverload hands the errors back and decides onIsSuccesswith a non-null value, so a success carrying a null value takes its failing branch there (ResultUiExtensions.cs:103-120, the check at:110, documented at:90-95). The live text no longer attributes theIsFailuredecision to the UI extension. - Added:
DbUpdateExceptionHandlercounts aDbUpdateConcurrencyException(and only that kind) throughConcurrencyConflictMetrics.RecordConflictbefore answering 409 (DbUpdateExceptionHandler.cs:36-39); the client detail stays the fixed generic string (:45). - Anchors re-verified against current source:
Result.cs:254-258,:270,:250-253,:266-269,:281-289,:297-301,:310-314,:323-327,:335-345,:355-366,:376-386, short-circuits:300,:313,:326,:360-363(the non-generic:43,:49-53,:155,:169,:187did not move);DbUpdateExceptionHandler.cs:29,:32,:41,:45;ResultUiExtensions.cs:132-146(:142,:145),:214,:226,:255,:258,:276,:279,:294-298,:306,:314,:316-339(:318-321,:326),:343-349,:352-362,:366-371,:373-382(:23-27,:27-33,:30-33and:74did not move). The 2026-10-21 entry above keeps itsCHANGELOG.md:93and:230as written; the v1.247.0 and v1.241.0 entries now sit atCHANGELOG.md:308and:445.
Revision (2026-10-28)
Re-verified against current source. The decision, the ten categories, the severity ranking, the exception-handler order, the executor's fault set and the code-based localization lookup are unchanged; three live descriptions were broader than the code, and are narrowed.
- Corrected: the code-based lookup covers only a bodiless
Http.{status}and the executor'sHttp.TransportFailure/Http.Timeout(ResultUiExtensions.cs:326,:333,:366-371). The reader'sHttp.EmptyResponseandHttp.MalformedResponse(ProblemDetailsResultReader.cs:71,:77) fall through to the message pass-through (ResultUiExtensions.cs:338) and have noSharedResource.resxkey (SharedResource.resx:796,:832,:835), so they render in English. - Added: when the wrapped operation reads through
ProblemDetailsResultReader, the reader handles a body-readHttpRequestException(ProblemDetailsResultReader.cs:338-347, anHttp.EmptyResponseon a 2xx for the typedReadAsync<T>at:303-310; the valuelessReadAsyncdoes not read a 2xx body,:259-262) and a 2xxJsonException(Http.MalformedResponse,:323-326) before the executor sees them, and that malformed-response failure carries the exception text onMessage(:325), unlike the executor, which puts it onSource(HttpResultExecutor.cs:130-133). - Corrected: the Rationale no longer states that the Result channel carries
requestId. The extension is stamped by theAddProblemDetailscustomization (DependencyInjection.cs:156-158),HandleFailurebuilds and returns its body directly on a non-empty error list (ApiControllerBase.cs:50-60; the empty-list branch returnsProblem(...),:39-45), and the conformance base acceptserrorsor a correlation id (ProblemDetailsContractTestsBase.cs:77-81). - Anchors re-verified against current source:
ResultUiExtensions.cs:27-33,:316-339,:326,:333,:338,:366-371;ProblemDetailsResultReader.cs:71,:77,:303-310,:323-326,:338-347;HttpResultExecutor.cs:127-128,:130-133;ApiControllerBase.cs:50-60. The 2026-10-26 entry above keeps itsCHANGELOG.mdanchors as written; the one-argumentResultUiExtensions.TryGetValueremoval now sits atMMCA.Common/CHANGELOG.md:244, and the v1.247.0 and v1.241.0 headings at:303and:474.
Revision (2026-11-23)
Re-verified against current source. The decision, the ten categories and their HTTP and gRPC
mappings, the severity ranking, the all-errors ProblemDetails body, the exception-handler order and
the MobileInfiniteScrollList failure behavior are unchanged; one field and one header were added
without being recorded, and anchors into seven files moved.
- Added:
Errorcarries an init-onlyTimeSpan? RetryAfter, null by default, set withwith { RetryAfter = ... }on aTooManyRequestserror (MMCA.Common/Source/Core/MMCA.Common.Shared/Abstractions/Error.cs:31-37); the sign-in lockout sets it (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Auth/LoginProtectionService.cs:107). - Added:
HandleFailureanswers a 429 with aRetry-Afterheader taken from the longestRetryAfteramong itsTooManyRequestserrors, formatted byRetryAfterHeader.Format; any other status, or a 429 carrying no positive hint (a null, zero or negativeRetryAfter,:97), sends no header (ApiControllerBase.cs:74,SetRetryAfterat:79-101, the header at:99). Shipped in v1.295.0. The value is not part of theerrorsprojection (ErrorHttpMapping.cs:65-74), and neitherProblemDetailsResultReadernor the gRPC edge reads or writes it, so it does not round-trip. - Anchors re-verified against current source:
ErrorHttpMapping.cs:23-35(Unexpectedat:33,TooManyRequestsat:34),:44-51,:54-55,:65-74;Error.cs:111-112,:134-135;ApiControllerBase.cs:49-77(empty-listProblem(...)at:53-59, status at:62, body at:64-72,StatusCode(...)at:76);DependencyInjection.cs:157-169(AddProblemDetailsat:159-161, registrations:162-166,GlobalExceptionHandlerlast at:166);SharedResource.resx:844,:847-877,:880,:883;MobileInfiniteScrollList.razor.cs:47,:104-116(:111,:113-114),:187-193(:191),:210-219(:218),:281-285,:286-290(:289);ProblemDetailsContractTestsBase.cs:76-80. The dated entries above keep their anchors as written; theirCHANGELOG.mdline numbers are best read by version heading.
Revision (2026-11-30)
Re-verified against current source (MMCA.Common v1.323.0, MMCA.Common/CHANGELOG.md:7). The
Result-over-exceptions decision, the edge-only transport mapping, the all-errors ProblemDetails
body, severity-ranked status selection, the UI layer's Result surface and the error-catalog gate
are unchanged; the category set, the combinator surface, the construction rules and the
exception-handler chain moved.
Context. ErrorType.Failure ("general/unclassified", HTTP 400, severity 10) had become the
default for dependency outages, timeouts and host misconfiguration, so a caller was told to fix a
request that was well formed, 5xx alerting never saw the outage, and the timeout decorators
documented that the taxonomy had no member for them.
Decision.
ErrorType.Unavailableis the category for a dependency that failed or did not answer in time (MMCA.Common/Source/Core/MMCA.Common.Shared/Abstractions/ErrorType.cs:61-67, factory atError.cs:125-126): HTTP 503 (ErrorHttpMapping.cs:34), gRPCUnavailablein both directions (ResultGrpcExtensions.cs:50, rebuilt from a trailer through:274), severity 65 betweenUnexpectedandUnauthorized(ErrorTypeSeverity.cs:42), aRetryAfteron it answered as the 503'sRetry-Afterheader (ApiControllerBase.cs:96-98,:110), and 503 read back asUnavailable(ProblemDetailsResultReader.cs:101).FailureandError.Failureare removed, so every error names a meaning:Validation,InvariantorUnprocessableEntitywhen the caller can fix the request,Unavailablewhen retrying later can succeed,Unexpectedwhen neither holds (ErrorType.cs:13-16). Member values are pinned explicitly and 7 is retired (:16-18,:53,:59,:67). The reader reads any other unmapped 4xx asValidation(ProblemDetailsResultReader.cs:140), the gRPC trailer decoder rebuilds an unknown type asUnexpected(ResultGrpcExtensions.cs:279-284), the timeout decorators returnRequest.TimedOutasUnavailable(ADR-014, Revision 2026-11-30), and the error-catalog rule recognizes theUnavailablefactory (ArchitectureRules.ErrorCatalog.cs:27, in the list at:17-30). Every framework site that returnedFailurewas reclassified (MMCA.Common/CHANGELOG.md:9,:11).- The unused railway helpers are removed:
ResultExtensions(BindAsync,MapAsync,MatchAsync,TapAsyncoverTask<Result<T>>),Result<T>.Ensure,Result<T>.Tap,Result<T>.MatchAsyncandResult.OnFailure(MMCA.Common/CHANGELOG.md:13).Match,Map,Bind,BindAsync,Combine,TryGetValueand the implicit conversions remain, with early return throughTryGetValueas the idiom for a multi-step handler. - The
Result()constructor andAddErrorsareprivate protected(Result.cs:31,:64) andResult<T>is sealed (:192), so aResultis built only through its factories and conversions and cannot be subclassed outside MMCA.Common.Shared. DomainException,DomainInvariantViolationExceptionandDomainExceptionHandlerare deleted, since nothing threw them (MMCA.Common/CHANGELOG.md:15);AddCommonExceptionHandlers()registers four handlers, OperationCanceled, DbUpdate, Validation and Global (DependencyInjection.cs:162-165).
Consequences. Outages surface as 503 or 500 and reach 5xx alerting. The reverse mapping is
lossy only between Validation and Invariant (ProblemDetailsResultReader.cs:50-57). A reader
that does not recognize a type name falls back to the status-derived type (:50-52, :437-439),
and a reader with no 503 entry derives a 5xx as Unexpected, the rule this reader still applies to
every other 5xx (:124, :140). HttpResultExecutor transport and timeout errors stay Unexpected
(MMCA.Common/CHANGELOG.md:9). Breaking for external consumers, mapped in
MMCA.Common/UPGRADING.md:35.
Alternatives rejected. Keeping Failure and only moving sites (leaves the unclassified bucket
that caused the drift); mapping outages to Unexpected alone (loses the retry-later signal and
Retry-After); adopting the railway combinators codebase-wide (the early-return sites already read
well and debug more easily).
Corrected in place. The Status line; the Decision's category list, the Unexpected,
TooManyRequests and Unavailable descriptions and the pinned-values sentence (it said
TooManyRequests was appended last so earlier values would not move); the RetryAfter producer
sentence; the combinator surface (the MatchAsync, Tap, Ensure, OnFailure and
ResultExtensions entries removed); the HTTP Retry-After sentence, which now covers a 503; the
gRPC table; the severity ranking; the DomainExceptionHandler step of the exception-handler chain;
and the two 400 trade-offs (two categories share the 400 rank, not three). The earlier dated
sections keep their wording as historical records, including the 2026-08-27 subsection's account
of the retired rethrow.
Anchors re-verified against current source: ErrorType.cs:5-11, :13-16, :16-18,
:47-53, :49-51, :55-59, :61-67; Error.cs:31-38, :112-113, :125-126, :131-133,
:140-141; Result.cs:31, :50, :56-60, :64, :75, :108, :131-152, :162-168,
:176-180 (:179), :192, :206-216 (:208), :242-246, :258, :269-277, :285-289
(:288), :298-302 (:301), :311-315 (:314); ErrorTypeSeverity.cs:16-27, :22, :32,
:39-51, :49-50, :53-57, :60, :72-99, :86-87, :91; ErrorHttpMapping.cs:23-35
(Unexpected :32, TooManyRequests :33, Unavailable :34), :44-51, :54-55, :65-74
(:70); ApiControllerBase.cs:50-78 (empty-list Problem(...) at :56-59, status at :63, body
at :65-73, SetRetryAfter call at :75, StatusCode(...) at :77), :89-112 (:92-103,
:108, :110); ResultGrpcExtensions.cs:41-50, :104, :120, :125, :136-138, :274,
:279-284; DependencyInjection.cs:157-168 (AddProblemDetails at :159-161, registrations
:162-165, GlobalExceptionHandler last at :165); ProblemDetailsResultReader.cs:50-57,
:97-109 (:101, :107), :124, :126-129, :140, :380, :437-439. The 503 row moved the
reader's members, so the reader anchors in "The client half" above read, by member:
ProblemDetailsResultReader :59, EmptyResponseCode :72, MalformedResponseCode :78,
ParseProblemDetails :158, ReadAsync :256, ReadAsync<T> :291, the JsonException catch
:326 (message at :328), the body-read HttpRequestException catch :345, ReadErrorArray
:353, ReadErrorObject :376 (type read at :380), ReadValidationDictionary :390,
ParseErrorType :437, SynthesizeError :444, the case-insensitive lookup :493.
Related
ADR-007 (Result over the wire via gRPC, the second edge the shared severity
ranking now serves),
ADR-014 (the decorator pipeline returns Result.Failure to
short-circuit a command before it reaches the handler),
ADR-094 (the client base hierarchy whose dispatch method now ends
in a Result instead of a rethrow, and which owns the retry and idempotency behavior around it),
ADR-027 (the localization contract the page-side helpers honor: an API
message arrives already translated, a client-side one is a resource key, and pass-through lookup
serves both from one call site).