Hi all,
catch e
if e isa (Sockets.DNSError)
# print message
elseif e isa (HTTP.StatusError)
# print message
end
end
# ...
I know that the Sockets.DNSError can either be triggered by an invalid URL or having no internet connection when running the program, but the former isn’t an option within my program anyway so I need to go for the latter by simulating no internet connection.
Does anybody know of a way to programmatically simulate having no internet connection for testing purposes? I’m mainly looking to improve my code coverage test results and also just generally check that in my runtests.jl file that I am accounting for behavior arising from no internet connection.
Thanks.