diff options
| author | Dan Engelbrecht <[email protected]> | 2024-01-31 14:23:12 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-01-31 14:23:12 +0100 |
| commit | 5cf15227e1cb41ba870786b833d27abbe5f9d966 (patch) | |
| tree | 2369245d3aaa756c2fd76f7a3af5a3a377fa6381 /src/zenhttp/httpclient.cpp | |
| parent | improve oplog export logging (#644) (diff) | |
| download | zen-5cf15227e1cb41ba870786b833d27abbe5f9d966.tar.xz zen-5cf15227e1cb41ba870786b833d27abbe5f9d966.zip | |
Actually thow exception if we can't parse the jobid when starting async job (#645)
Return system error code on exception throw in zen command
Clean up HttpClient::Response::ErrorMessage to remove redundant ": "
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); } } |