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:
parent
6ae8357c65
commit
8df7fd1180
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue