Skip to content

Commit e719c5f

Browse files
committed
Use DioException instead of DioError
This will fix the deprecation warning
1 parent 046e49e commit e719c5f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/src/http_request.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class HttpRequest {
6565
queryParameters: queryParameters,
6666
data: data,
6767
);
68-
} on DioError catch (e) {
68+
} on DioException catch (e) {
6969
return _throwException(e);
7070
}
7171
}
@@ -86,7 +86,7 @@ class HttpRequest {
8686
contentType: contentType,
8787
),
8888
);
89-
} on DioError catch (e) {
89+
} on DioException catch (e) {
9090
return _throwException(e);
9191
}
9292
}
@@ -107,7 +107,7 @@ class HttpRequest {
107107
contentType: contentType,
108108
),
109109
);
110-
} on DioError catch (e) {
110+
} on DioException catch (e) {
111111
return _throwException(e);
112112
}
113113
}
@@ -128,7 +128,7 @@ class HttpRequest {
128128
contentType: contentType,
129129
),
130130
);
131-
} on DioError catch (e) {
131+
} on DioException catch (e) {
132132
return _throwException(e);
133133
}
134134
}
@@ -145,14 +145,14 @@ class HttpRequest {
145145
data: data,
146146
queryParameters: queryParameters,
147147
);
148-
} on DioError catch (e) {
148+
} on DioException catch (e) {
149149
return _throwException(e);
150150
}
151151
}
152152

153-
Never _throwException(DioError e) {
153+
Never _throwException(DioException e) {
154154
final message = e.message ?? '';
155-
if (e.type == DioErrorType.badResponse) {
155+
if (e.type == DioExceptionType.badResponse) {
156156
throw MeiliSearchApiException.fromHttpBody(message, e.response?.data);
157157
} else {
158158
throw CommunicationException(message);

0 commit comments

Comments
 (0)