describeFourdgsRefusal function

FourdgsNamedRefusal? describeFourdgsRefusal(
  1. Object error, {
  2. FourdgsWalk? walk,
  3. FourdgsRefusalSite? site,
})

Everything the tool can say about one refusal: the identifier and the byte.

null for an error the refusal table does not name — a truncated transport, a declared length past this build's ceiling. That is not a failure of this function; it is the decoder saying "this is not one of the refusals the corpus compares", and a tool that invented an identifier there would be inventing conformance.

Implementation

FourdgsNamedRefusal? describeFourdgsRefusal(
  Object error, {
  FourdgsWalk? walk,
  FourdgsRefusalSite? site,
}) {
  if (error is! FourdgsException) return null;
  final String? code = error.refusalCode;
  if (code == null) return null;
  return FourdgsNamedRefusal(code, site ?? _placeFrontMatter(walk, code));
}