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:
parent
c4e5d06d91
commit
e4a036f18a
1 changed files with 14 additions and 1 deletions
15
ircd/m.cc
15
ircd/m.cc
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue