Skip to content

Commit

Permalink
Properly handle network exceptions in ronin url --status (closes #211
Browse files Browse the repository at this point in the history
…).

* Print an error message to stderr containing the URL and the exception
  message.
  • Loading branch information
postmodern committed Aug 12, 2024
1 parent 594f94e commit a1e8021
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ronin/cli/commands/url.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ def process_value(url)
elsif options[:fragment]
puts uri.fragment
elsif options[:status]
puts "#{uri.status} #{uri}"
begin
puts "#{uri.status} #{uri}"
rescue => error
stderr.puts "#{uri}: #{error.message}"
end
else
puts uri
end
Expand Down

0 comments on commit a1e8021

Please sign in to comment.