xerkonix_error_handler 1.1.0
xerkonix_error_handler: ^1.1.0 copied to clipboard
A comprehensive error and exception handling package for Flutter applications. Provides structured error types, custom exceptions, error message handlers, and UI components (dialogs, toasts) for consi [...]
Changelog #
All notable changes to this project will be documented in this file.
1.1.0 #
Added #
XkMessageRegistry— acode-keyed, localizable message registry with resolution order businesscode→ HTTPstatusCode/type→ generic fallback. Instance-based (per-lookup), not a global mutable slot. ShipsXkMessageRegistry.korean()bundling the full COSENTIO_* Korean set (auth / quota / validation / engine / relationship / ai-input / admin) plus HTTP-status and network fallbacks.metadata(Map<String, dynamic>) andstatusCodefields onXkError/XkErrors; the businesscodeis preserved for lookup.XkErrorNormalizer— HTTP-envelope adapter (fromEnvelope, parsing{error:{code,title,detail,message,metadata}}/{detail}with thestatusCode >= 400rule),fromStatusCode(int)mapping, andnormalizeException(TimeoutException/SocketException/ClientException/ FormatException → typed subtypes). Also surfaced asXkErrors.fromStatusCode.- New error subtypes:
PaymentRequired(402/quota) andTooManyRequests(429/rate-limit), plus syntheticNetworkTimeout/NetworkUnknown(withXkErrorCodesconstants). - Real toast + snackbar renderers:
error_toast.dartnow providesXkErrorToast(top-sliding overlay, auto-dismiss, error/warn colour, at parity withshowCosentioToast), plusshowXkToastandshowXkSnackBar. The previously deadWidgetType.toast/WidgetType.snackBarbranches in the message handler are now implemented. XkErrorHooks— acode/status-keyed side-effect/retry hook surface so codes likeGUEST_LIMIT_REACHED(toast+navigate) or401(refresh-retry-once) can be wired without product-specific branching.
Changed #
- Bumped SDK constraints to Dart
>=3.9.0 <4.0.0, Flutter>=3.35.0. - Bumped
xerkonix_loggerconstraint to^1.1.0. - Barrel now also exports the message/dialog/toast types and the new registry, normalizer and hooks.
Deprecated #
XkErrorMessageHandler(the static single-slot handler) in favour of the instance-basedXkMessageRegistry. It keeps working unchanged.
All existing XkError / XkErrors / XkException / XkErrorMessageHandler /
XkErrorDialog APIs remain source-compatible.
1.0.0 #
Initial Release #
- Comprehensive error and exception handling system
- Structured error types with code, type, message, title, and detail
- Custom exception class (
XkException) for error handling - Predefined error factory (
XkErrors) for common HTTP error types - Error message handler (
XkErrorMessageHandler) for displaying errors - Support for dialog and snackbar error display widgets
- Integration with xerkonix_logger for error logging
- Full platform support (Web, iOS, Android, Linux, macOS, Windows)
- Full Flutter 3.24+ and Dart 3.5+ compatibility