diff --git a/lib/src/adapters/dio_adapter.dart b/lib/src/adapters/dio_adapter.dart index 0967abe..7ae370e 100644 --- a/lib/src/adapters/dio_adapter.dart +++ b/lib/src/adapters/dio_adapter.dart @@ -46,6 +46,7 @@ class DioAdapter with Recording, RequestHandling implements HttpClientAdapter { Future? cancelFuture, ) async { if (_isClosed) { + logger.e('Cannot establish connection after [$runtimeType] got closed!'); throw ClosedException( 'Cannot establish connection after [$runtimeType] got closed!', ); diff --git a/test/adapters/dio_adapter_test.dart b/test/adapters/dio_adapter_test.dart index 52b49d9..da641ca 100644 --- a/test/adapters/dio_adapter_test.dart +++ b/test/adapters/dio_adapter_test.dart @@ -25,8 +25,10 @@ void main() { expect( () async => await dio.get('/route'), - throwsA(predicate( - (DioException dioError) => dioError.error is ClosedException)), + throwsA(predicate((DioException dioError) => + dioError.error is ClosedException && + dioError.error.toString() == + 'ClosedException: Cannot establish connection after [DioAdapter] got closed!')), ); });