Repository navigation
fix: return an error when --whois is used with a non-domain query - #61
ferhalemre wants to merge 1 commit into
Conversation
--whois only supports domain objects. For any other object type the CLI printed nothing and exited 0, so scripts could not tell that the output was missing. Check the response type before printing and exit 1 with an explanatory message instead. Fixes openrdap#37 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Low Merge Risk:
|
Fixes #37.
--whoisonly supports domain objects, but for any other object type (autnum, IP network, entity, ...) the CLI printed nothing and exited 0. Scripts had no way to tell that the output was missing.This change checks the response type before printing and exits 1 with
--whois output is only supported for domain querieswhen the object is not a domain.One behaviour to confirm: with
--whois --jsonon a non-domain query the command now fails before printing the JSON as well. If you would rather print the other formats and only warn about--whois, I'm happy to change it.Tests: three new golden cases (autnum text, autnum
--whois, autnum--whois --json). The two--whoiscases fail without the fix.go test -race ./...passes.Disclosure: this change was prepared with an AI coding assistant (Claude Code). The bug was reproduced and the tests were run locally before submitting.
🤖 Generated with Claude Code
Summary by CodeRabbit
--whoiswith an AS number query now reports that WHOIS output is available only for domain queries and exits with an error status.