diff --git a/cmd/robots2policy/main.go b/cmd/robots2policy/main.go index 481c4f37..811fc156 100644 --- a/cmd/robots2policy/main.go +++ b/cmd/robots2policy/main.go @@ -85,6 +85,11 @@ func main() { // Convert to Anubis rules anubisRules := convertToAnubisRules(rules) + // Check if any rules were generated + if len(anubisRules) == 0 { + log.Fatal("no valid rules generated from robots.txt - file may be empty or contain no disallow directives") + } + // Generate output var output []byte switch strings.ToLower(*outputFormat) {