diff options
Diffstat (limited to 'src/zenhttp/httpclient.cpp')
| -rw-r--r-- | src/zenhttp/httpclient.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/zenhttp/httpclient.cpp b/src/zenhttp/httpclient.cpp index cc8a3f033..9811e5814 100644 --- a/src/zenhttp/httpclient.cpp +++ b/src/zenhttp/httpclient.cpp @@ -1089,11 +1089,16 @@ HttpClient::Response::ErrorMessage(std::string_view Prefix) const } else if (StatusCode != HttpResponseCode::ImATeapot && (int)StatusCode) { - return fmt::format("{}: HTTP error {} {} ({})", Prefix, (int)StatusCode, zen::ToString(StatusCode), ToText()); + return fmt::format("{}{}HTTP error {} {} ({})", + Prefix, + Prefix.empty() ? ""sv : ": "sv, + (int)StatusCode, + zen::ToString(StatusCode), + ToText()); } else { - return fmt::format("{}: {}", Prefix, "unknown error"); + return fmt::format("{}{}unknown error", Prefix, Prefix.empty() ? ""sv : ": "sv); } } |