mirror of
https://github.com/matrix-construct/construct
synced 2024-12-01 19:22:53 +01:00
modules/s_fetch: Handle more detailed exception types.
This commit is contained in:
parent
693cd317ff
commit
f84e2ce618
1 changed files with 19 additions and 9 deletions
|
@ -808,18 +808,28 @@ try
|
||||||
dock.notify_all();
|
dock.notify_all();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch(const std::exception &e)
|
catch(const http::error &e)
|
||||||
{
|
{
|
||||||
const auto level
|
|
||||||
{
|
|
||||||
run::level == run::level::QUIT?
|
|
||||||
log::DERROR:
|
|
||||||
log::ERROR
|
|
||||||
};
|
|
||||||
|
|
||||||
log::logf
|
log::logf
|
||||||
{
|
{
|
||||||
log, level, "Failed to start request for %s in %s to '%s' :%s",
|
log, run::level == run::level::QUIT? log::DERROR: log::ERROR,
|
||||||
|
"Failed to start request for %s in %s to '%s' :%s %s",
|
||||||
|
string_view{request.event_id},
|
||||||
|
string_view{request.room_id},
|
||||||
|
string_view{request.origin},
|
||||||
|
e.what(),
|
||||||
|
e.content,
|
||||||
|
};
|
||||||
|
|
||||||
|
server::cancel(request);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch(const std::exception &e)
|
||||||
|
{
|
||||||
|
log::logf
|
||||||
|
{
|
||||||
|
log, run::level == run::level::QUIT? log::DERROR: log::ERROR,
|
||||||
|
"Failed to start request for %s in %s to '%s' :%s",
|
||||||
string_view{request.event_id},
|
string_view{request.event_id},
|
||||||
string_view{request.room_id},
|
string_view{request.room_id},
|
||||||
string_view{request.origin},
|
string_view{request.origin},
|
||||||
|
|
Loading…
Reference in a new issue