From f38a4e7c7db83aa5efb08ee3149b6dc222ced198 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sun, 19 Jul 2026 12:41:05 +0200 Subject: [PATCH] fix(api): keep DioExceptionType switch exhaustive across dio versions CI resolves dependencies fresh (pubspec.lock is gitignored), so the v1.7.0 build failed when dio 5.10 introduced transformTimeout. A default clause absorbs future enum additions on either dio version; unknown keeps identical behavior through it. Co-Authored-By: Claude Fable 5 --- CHANGELOG.md | 5 +++++ lib/core/api/api_interceptors.dart | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fec7743..5d90161 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Web build failure with dio >= 5.8: `DioExceptionType` switch is now + exhaustive across dio versions (CI resolves dependencies fresh) + ## [1.7.0] - 2026-07-19 ### Changed diff --git a/lib/core/api/api_interceptors.dart b/lib/core/api/api_interceptors.dart index 3fd19d2..30a5673 100644 --- a/lib/core/api/api_interceptors.dart +++ b/lib/core/api/api_interceptors.dart @@ -163,7 +163,10 @@ class ErrorInterceptor extends Interceptor { case DioExceptionType.badCertificate: return const NetworkException(message: 'Invalid SSL certificate'); - case DioExceptionType.unknown: + // default keeps this exhaustive across dio versions (CI resolves deps + // fresh — pubspec.lock is gitignored — so DioExceptionType can gain + // cases, e.g. transformTimeout in dio >= 5.8) + default: return NetworkException( message: err.message ?? 'Unknown error', cause: err,