resultex_network 1.2.0
resultex_network: ^1.2.0 copied to clipboard
A robust network error mapping adapter for the Resultex ecosystem using Dio.
Changelog #
All notable changes to the resultex_network package will be documented in this file.
1.2.0 - 2026-07-28 #
- New Feature: Added robust offline-first and smart caching policies (
CachePolicy.swr,CachePolicy.cacheFirst,CachePolicy.networkFirst). - New Class: Introduced
ResultexOfflineFirstHandlerto seamlessly manage request caching, background revalidation, and network fallbacks. - Refactoring & Fixes: Fixed Linter warnings regarding HTML tags in documentation comments (
unintended_html_in_doc_comment).
1.1.0 - 2026-07-17 #
Added #
- Connectivity: Introduced
ResultexConnectivityInterceptorfor proactive offline state detection, preventing unnecessary requests. - Observability: Added
ResultexLoggerInterceptorfor automated network logging, integrated withresultex_loggerfor clean and efficient debugging. - Functional Integration: Implemented
DioResultExtension.guard()to seamlessly bridge raw Dio requests with the functionalResulttype paradigm. - Advanced Failures: Added domain-specific failure types for better error granularity:
RateLimitFailure(HTTP 429)TimeoutFailure(Connection/Receive/Send timeouts)OfflineFailure(Device connectivity issues)
- Centralized Error Handling: Created
ResultexDioInterceptoras a robust, chainable error handler.
Changed #
- Mapping: Refined
HttpStatusMapperto support advanced HTTP status codes (429, 503, 500) with descriptive default messages. - Resilience: Enhanced
DioResultExtensionto support HTTP 204 (No Content) responses and handle nullable data payloads gracefully. - Logic: Optimized
ResultexDioInterceptorto respect pre-mapped domain failures from previous interceptors.
1.0.0 - 2026-07-16 #
Added #
- Initial Release: Launched the official network companion adapter for the Resultex error-handling ecosystem.
- Dio Integration: Added
ResultexDioInterceptorto capture and intercept low-level socket timeouts, connection losses, and bad responses. - HTTP Status Mapper: Implemented
HttpStatusMapperto translate standard HTTP status codes ( 400, 401, 403, 404, 500, 503) into domain-specific failures. - Structured Validation Handling: Added specialized parsing for
HTTP 422validation errors, extracting nested field-level error maps (highly compatible with Laravel, NestJS, and Django). - Safe Execution Guard: Created the
.guard()extension onFuture<Response>to automatically map success payloads and unpack intercepted failures into type-safeResultmonads. - Umbrella Export: Configured the package to automatically re-export the core
resultexlibrary, eliminating double-import fatigue for consumers.