0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-09 13:38:55 +02:00

ircd:Ⓜ️:error: Gracefully handle string content case.

This commit is contained in:
Jason Volk 2020-08-04 19:32:58 -07:00
parent 6ae8357c65
commit 8df7fd1180

View file

@ -102,6 +102,9 @@ const noexcept try
this->http::error::content
};
if(json::type(content, std::nothrow) == json::STRING)
return string_view{content};
const json::string &ret
{
content["error"]
@ -123,6 +126,9 @@ const noexcept try
this->http::error::content
};
if(json::type(content, std::nothrow) == json::STRING)
return "M_UNKNOWN"_sv;
const json::string &ret
{
content.get("errcode", "M_UNKNOWN"_sv)