From 6b16bdd76c419e59e65ee8006220597ec2bbb9d3 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 9 Jul 2019 01:38:53 -0700 Subject: [PATCH] modules/net_dns: More catch block. --- modules/net_dns.cc | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/modules/net_dns.cc b/modules/net_dns.cc index 3bafa9293..ec23e6f49 100644 --- a/modules/net_dns.cc +++ b/modules/net_dns.cc @@ -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