Table of Contents

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

body string

The raw response body.

fallback string

The default message when the body carries no problem text.

problem HonuaProblemDetails

The 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

body string

The raw response body.

problem HonuaProblemDetails

The parsed problem, or null when the body is empty or not problem JSON.

Returns

bool

true when a problem document was parsed.