Class HonuaProblemDetailsParser
- Namespace
- Honua.Sdk.Abstractions
- Assembly
- Honua.Sdk.Abstractions.dll
Shared parser for RFC 7807 problem-details bodies. Replaces the per-client reimplementations so
every REST client extracts type/title/detail/status/instance
identically and via source-generated JSON.
public static class HonuaProblemDetailsParser
- Inheritance
-
HonuaProblemDetailsParser
- Inherited Members
Methods
ResolveMessage(string?, string, out HonuaProblemDetails?)
Parses body and selects the best human-readable message, falling back to
fallback when no problem detail/title is present.
public static string ResolveMessage(string? body, string fallback, out HonuaProblemDetails? problem)
Parameters
bodystringThe raw response body.
fallbackstringThe default message when the body carries no problem text.
problemHonuaProblemDetailsThe parsed problem, if any.
Returns
- string
The resolved error message.
TryParse(string?, out HonuaProblemDetails?)
Attempts to parse body as an RFC 7807 problem-details document.
public static bool TryParse(string? body, out HonuaProblemDetails? problem)
Parameters
bodystringThe raw response body.
problemHonuaProblemDetailsThe parsed problem, or null when the body is empty or not problem JSON.