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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user