diene_problems 0.1.1 copy "diene_problems: ^0.1.1" to clipboard
diene_problems: ^0.1.1 copied to clipboard

RFC 9457 problem-details for Dart: envelope with the `data` extension, one type-URI builder, a typed registry, LocalError wrapping, and per-endpoint catalog export.

diene_problems #

RFC 9457 problem-details machinery for the Dart family: the envelope with the data extension, a single-source type-URI builder, a typed registry, an error→Problem transformer, LocalError wrapping, and per-endpoint catalog export including the recoverable flag.

This is the Dart port of the L-bun problems contract (C0 §2/§14). It is frontend-only machinery: there is no runtime error-info HTTP surface, and telemetry rides Faro via the frontend path, not an otel exporter.

Install #

dependencies:
  diene_problems: ^0.1.0

Usage #

import 'package:diene_problems/diene_problems.dart';

final portal = ErrorPortal(
  scheme: 'https',
  host: 'docs.raichu.cluster.atomi.cloud',
  landscape: 'raichu',
  platform: 'dotnet',
  service: 'user',
  module: 'api',
);

// The ONE place a problem type URI is built.
final type = problemTypeUri(portal: portal, version: 'v1', id: 'entity_not_found');

final registry = ProblemRegistry(portal)..register(GenericProblems.entityNotFound);
final catalog = ProblemCatalog(portal: portal)..addGenerics();
final crdContent = catalog.toCrdContent(); // C0 §14 Problem CR payload

Wrap an unexpected client exception:

final problem = await LocalError(sink).wrap(error, StackTrace.current);

TestHelper #

package:diene_problems/test_helper.dart ships framework-free helpers (expectProblem, aProblem, aCatalogEntry) usable from any test runner without adding a test-framework dependency. See doc/diene_problems.md and the shipped usage skill at skills/diene-problems-usage/SKILL.md.

Commands #

  • pls setup — resolve dependencies and sync vendored skills.
  • pls analyzedart analyze.
  • pls testdart test.
  • pls test:coverage — tests with lcov coverage.
  • pls test:meta — meta tier over test_helper.dart.
  • pls lint — every pre-commit gate.

Shared standards #

0
likes
160
points
1.81k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

RFC 9457 problem-details for Dart: envelope with the `data` extension, one type-URI builder, a typed registry, LocalError wrapping, and per-endpoint catalog export.

Repository (GitHub)
View/report issues

Topics

#rfc-9457 #problem-details #errors #api

License

MIT (license)

More

Packages that depend on diene_problems