mirror of
https://github.com/matrix-construct/construct
synced 2024-10-02 13:48:53 +02:00
modules/client/rooms/invite: Improve error reporting.
This commit is contained in:
parent
5c8a97c43e
commit
09ea0be2f0
1 changed files with 19 additions and 7 deletions
|
@ -167,12 +167,25 @@ try
|
||||||
room_id, event_id, proto, buf, std::move(opts)
|
room_id, event_id, proto, buf, std::move(opts)
|
||||||
};
|
};
|
||||||
|
|
||||||
request.wait(seconds(10)); //TODO: conf
|
http::code rcode; try
|
||||||
const http::code &rcode
|
|
||||||
{
|
{
|
||||||
request.get()
|
request.wait(seconds(10)); //TODO: conf
|
||||||
|
rcode = request.get();
|
||||||
|
}
|
||||||
|
catch(const http::error &e)
|
||||||
|
{
|
||||||
|
log::error
|
||||||
|
{
|
||||||
|
"Invite %s to %s :%s :%s",
|
||||||
|
string_view{event.event_id},
|
||||||
|
string(opts.remote),
|
||||||
|
e.what(),
|
||||||
|
e.content,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
const json::object &response
|
const json::object &response
|
||||||
{
|
{
|
||||||
request
|
request
|
||||||
|
@ -205,14 +218,13 @@ try
|
||||||
m::vm::eval(revent, vmopts);
|
m::vm::eval(revent, vmopts);
|
||||||
return revent.event_id;
|
return revent.event_id;
|
||||||
}
|
}
|
||||||
catch(const http::error &e)
|
catch(const std::exception &e)
|
||||||
{
|
{
|
||||||
log::error
|
log::error
|
||||||
{
|
{
|
||||||
"Contacting remote for invite %s :%s :%s",
|
"Invite remote %s :%s",
|
||||||
string_view{event.event_id},
|
string_view{event.event_id},
|
||||||
e.what(),
|
e.what(),
|
||||||
e.content,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
throw;
|
throw;
|
||||||
|
|
Loading…
Reference in a new issue