Skip to content

Commit e425bba

Browse files
committed
Catch the exception and log a message
1 parent db3699a commit e425bba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/rex/proto/dns/cached_resolver.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ def send(argument, type = Dnsruby::Types::A, cls = Dnsruby::Classes::IN)
6262
resolved = super(resolve, type)
6363
req.instance_variable_set(:@answer, (req.answer + resolved.answer).uniq)
6464
resolved.answer.each do |ans|
65-
self.cache.cache_record(ans) rescue nil
65+
begin
66+
self.cache.cache_record(ans)
67+
rescue StandardError => e
68+
elog('Failed to cache the DNS answer', error: e)
69+
end
6670
end
6771
end
6872
# Finalize answers in response

0 commit comments

Comments
 (0)