Skip to content

Commit 0f96bb6

Browse files
CyberShadowGeod24
authored andcommitted
dlangbot.utils: Reduce severity of logging non-2xx responses
At this point, we do not yet know if this is a problem. expectOK should instead be used to convert non-2xx responses to exceptions.
1 parent 7c8e635 commit 0f96bb6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/dlangbot/utils.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ HTTPClientResponse request(
4848
scope void delegate(scope HTTPClientRequest) requester = cast(void delegate(scope HTTPClientRequest req))null
4949
) @safe
5050
{
51-
import vibe.core.log : logError;
51+
import vibe.core.log : logWarn;
5252
import vibe.http.client : requestHTTP;
5353
import vibe.http.common : HTTPMethod;
5454

@@ -62,7 +62,7 @@ HTTPClientResponse request(
6262
},
6363
httpClientSettings);
6464
if (res.statusCode / 100 != 2 && !expectedStatusCode(res.statusCode))
65-
logError("%s %s failed; %s %s.", method, url, res.statusPhrase, res.statusCode);
65+
logWarn("%s %s failed; %s %s.", method, url, res.statusPhrase, res.statusCode);
6666
return res;
6767
}
6868

@@ -72,7 +72,7 @@ void request(
7272
scope void delegate(scope HTTPClientResponse) responder
7373
) @safe
7474
{
75-
import vibe.core.log : logError;
75+
import vibe.core.log : logWarn;
7676
import vibe.http.client : requestHTTP;
7777
import vibe.http.common : HTTPMethod;
7878

@@ -85,7 +85,7 @@ void request(
8585
},
8686
(scope res) {
8787
if (res.statusCode / 100 != 2 && !expectedStatusCode(res.statusCode))
88-
logError("%s %s failed; %s %s.", method, url, res.statusPhrase, res.statusCode);
88+
logWarn("%s %s failed; %s %s.", method, url, res.statusPhrase, res.statusCode);
8989
responder(res);
9090
},
9191
httpClientSettings

0 commit comments

Comments
 (0)