Skip to content

Commit

Permalink
Fix: Missing double-quotes for error message
Browse files Browse the repository at this point in the history
Co-authored-by: Ash Vardanian <[email protected]>
  • Loading branch information
herpiko and ashvardanian authored Nov 29, 2023
1 parent 788e51c commit dd3d7d7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/protocol_rest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,15 @@ inline bool protocol_rest_t::append_response(exchange_pipes_t& pipes, std::strin

inline bool protocol_rest_t::append_error(exchange_pipes_t& pipes, std::string_view error_code,
std::string_view message) noexcept {

if (!pipes.append_outputs({R"({"error":)", 9}))
return false;
if (!pipes.append_outputs(error_code))
return false;
if (!pipes.append_outputs({R"(,"message":)", 11}))
if (!pipes.append_outputs({R"(,"message":")", 11}))
return false;
if (!pipes.append_outputs(message))
return false;
if (!pipes.append_outputs({"}", 1}))
if (!pipes.append_outputs({R"("})", 1}))
return false;
return true;
};
Expand Down

0 comments on commit dd3d7d7

Please sign in to comment.