0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

ircd:Ⓜ️:error: Improve the what() format on m::error.

This commit is contained in:
Jason Volk 2019-07-11 17:25:23 -07:00
parent c4e5d06d91
commit e4a036f18a

View file

@ -5254,7 +5254,20 @@ ircd::m::error::error(internal_t,
{
c, std::move(object), vector_view<const http::header>{_error_headers}
}
{}
{
if(!object.empty())
{
const json::string &_errcode(json::object(object).get("errcode"));
const json::string &_error(json::object(object).get("error"));
if(!strnlen(ircd::exception::buf, sizeof(ircd::exception::buf)))
strlcat(ircd::exception::buf, " ");
strlcat(ircd::exception::buf, _errcode);
strlcat(ircd::exception::buf, " :");
strlcat(ircd::exception::buf, _error);
}
}
ircd::string_view
ircd::m::error::errstr()