mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
modules/net_dns: More catch block.
This commit is contained in:
parent
ab25346534
commit
6b16bdd76c
1 changed files with 45 additions and 0 deletions
|
@ -480,6 +480,29 @@ try
|
|||
send(room_id, m::me, type, state_key, json::object(out.completed()));
|
||||
return true;
|
||||
}
|
||||
catch(const http::error &e)
|
||||
{
|
||||
log::error
|
||||
{
|
||||
log, "cache put (%s, %s) code:%u (%s) :%s %s",
|
||||
type,
|
||||
state_key,
|
||||
code,
|
||||
msg,
|
||||
e.what(),
|
||||
e.content,
|
||||
};
|
||||
|
||||
const json::value error_value
|
||||
{
|
||||
json::object{e.content}
|
||||
};
|
||||
|
||||
const json::value error_records{&error_value, 1};
|
||||
const json::strung error{error_records};
|
||||
call_waiters(type, state_key, error);
|
||||
return false;
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
log::error
|
||||
|
@ -580,6 +603,28 @@ try
|
|||
send(room_id, m::me, type, state_key, json::object{out.completed()});
|
||||
return true;
|
||||
}
|
||||
catch(const http::error &e)
|
||||
{
|
||||
log::error
|
||||
{
|
||||
log, "cache put (%s, %s) rrs:%zu :%s %s",
|
||||
type,
|
||||
state_key,
|
||||
rrs.size(),
|
||||
e.what(),
|
||||
e.content,
|
||||
};
|
||||
|
||||
const json::value error_value
|
||||
{
|
||||
json::object{e.content}
|
||||
};
|
||||
|
||||
const json::value error_records{&error_value, 1};
|
||||
const json::strung error{error_records};
|
||||
call_waiters(type, state_key, error);
|
||||
return false;
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
log::error
|
||||
|
|
Loading…
Reference in a new issue