Skip to content

Commit 3f23c43

Browse files
committed
Use "throwIfNotOk" in versions HTTP call
1 parent b57b58f commit 3f23c43

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/src/source/hosted.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,10 @@ class HostedSource extends CachedSource {
430430
(client) async {
431431
return await retryForHttp(
432432
'fetching versions for "$packageName" from "$url"', () async {
433-
return await client.read(url,
433+
final response = await client.get(url,
434434
headers: HostedSource.httpRequestHeadersFor(url));
435+
response.throwIfNotOk();
436+
return response.body;
435437
});
436438
});
437439
final decoded = jsonDecode(bodyText);

0 commit comments

Comments
 (0)