Skip to content

Conversation

@ic0ns
Copy link
Contributor

@ic0ns ic0ns commented Jun 23, 2025

Summary

  • Added exception message retention when UnknownHostException occurs
  • Implemented tracking of denylist reasons (domain vs IP) for better diagnostics
  • Created helper method to determine specific denylist causes

Changes

  • Added unresolvedReason field to store exception messages when host resolution fails
  • Added denylistReason field to track why a target was denylisted
  • Implemented determineDenylistReason() method to distinguish between domain and IP denylisting
  • Added corresponding getters and setters for the new fields

Test plan

  • Compiled and tested with mvn clean test
  • Code formatting verified with mvn spotless:apply
  • Manual testing of exception information retention
  • Manual testing of denylist reason tracking

This addresses issue #12 by retaining diagnostic information that was previously discarded, improving debugging capabilities for failed host resolutions and denylisted targets.

- Store UnknownHostException message when host resolution fails
- Track denylist reason (domain vs IP) for better diagnostics
- Add helper method to determine specific denylist cause
- Add getters/setters for new diagnostic fields

This addresses issue #12 by retaining diagnostic information
that was previously discarded, improving debugging capabilities.
@ic0ns
Copy link
Contributor Author

ic0ns commented Jun 23, 2025

looks good but I want to see tests

Comment on lines +139 to +141
private String unresolvedReason;

private String denylistReason;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dislike the approach of adding error only fields to the scan target.

@XoMEX
Copy link
Member

XoMEX commented Nov 4, 2025

I think the cleaner approach would be to wrap the caught exception into a TargetUnresolvable and TargetDenylisted exception and catch that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants