0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-29 00:03:45 +02:00

modules/s_fetch: Handle more detailed exception types.

This commit is contained in:
Jason Volk 2019-04-23 19:08:12 -07:00
parent 693cd317ff
commit f84e2ce618

View file

@ -808,18 +808,28 @@ try
dock.notify_all();
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, 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.room_id},
string_view{request.origin},