Skip to content

Improve error messages for target validation#1473

Open
DELTA-45-G wants to merge 2 commits intoOWASP:masterfrom
DELTA-45-G:fix-error-messages-target
Open

Improve error messages for target validation#1473
DELTA-45-G wants to merge 2 commits intoOWASP:masterfrom
DELTA-45-G:fix-error-messages-target

Conversation

@DELTA-45-G
Copy link
Copy Markdown

@DELTA-45-G DELTA-45-G commented Mar 30, 2026

Proposed change

This PR improves localization error messages in nettacker/locale/en.yaml for better clarity and usability.

Changes include:

  • Improved error_target message to clearly instruct users to use -t or --targets
  • Improved error_target_file message to provide a clearer file-related error description

These changes make CLI error messages more user-friendly and easier to understand for end users.

Type of change

  • New core framework functionality
  • Bugfix (non-breaking change which fixes an issue)
  • Code refactoring without any functionality changes
  • New or existing module/payload change
  • Documentation/localization improvement
  • Test coverage improvement
  • Dependency upgrade
  • Other improvement (best practice, cleanup, optimization, etc)

Checklist

  • I've followed the contributing guidelines
  • I have digitally signed all my commits in this PR
  • I've run make pre-commit and confirm it didn't generate any warnings/changes
  • I've run make test, I confirm all tests passed locally
  • I've added/updated any relevant documentation in the docs/ folder
  • I've linked this PR with an open issue
  • I've tested and verified that my code works as intended and resolves the issue as described
  • I have attached screenshots demonstrating my code works as intended
  • I've checked all other open PRs to avoid submitting duplicate work
  • I confirm that the code and comments in this PR are not direct unreviewed outputs of AI
  • I confirm that I am the Sole Responsible Author for every line of code, comment, and design decision

Thanks for contributing to OWASP Nettacker!
image

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d817136a-b707-458a-b3d2-d66d7df87962

📥 Commits

Reviewing files that changed from the base of the PR and between f4c1bbf and 3cc22cc.

📒 Files selected for processing (1)
  • nettacker/locale/en.yaml

Summary by CodeRabbit

  • Documentation
    • Clarified error message when no scan target is provided and added explicit instructions to use the target flag.
    • Improved wording for target file errors to make file open failures easier to understand.

Walkthrough

Edited three English localization strings in nettacker/locale/en.yaml to clarify target-related error messages and ensure the file ends with a newline.

Changes

Cohort / File(s) Summary
English localization
nettacker/locale/en.yaml
Rewrote error_target to "No target specified" and added -i/--targets instruction; changed error_target_file to "Target file error: cannot open file: {0}"; ensured file ends with a trailing newline (no other message content changes).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • arkid15r
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: improving error messages for target validation, which directly aligns with the file changes in nettacker/locale/en.yaml.
Description check ✅ Passed The description is well-related to the changeset, detailing specific improvements to error messages with clear before-and-after context that matches the file modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread nettacker/locale/en.yaml Outdated
Copy link
Copy Markdown
Author

@DELTA-45-G DELTA-45-G left a comment

Choose a reason for hiding this comment

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

Fixed the target flag from -t to -i in the localization file as per the feedback. Verified the output locally.

Copy link
Copy Markdown
Contributor

@pUrGe12 pUrGe12 left a comment

Choose a reason for hiding this comment

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

Looks good now

@securestep9
Copy link
Copy Markdown
Collaborator

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 11, 2026

✅ Actions performed

Full review triggered.

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