Skip to content

Zero assertions is reported as "Cannot perform request" with exit 93 #25

Description

@korya

Problem

Running with no assertion flags produces a network-failure-flavoured error and the network-failure exit code, even though the condition is detected before any request is attempted.

Reproduction

$ http-assert http://127.0.0.1:8791/ok

Error: Cannot perform request: no assertions defined
[exit=93]

Also reachable via --assert-body-empty=false, which parses to zero assertions.

Why it matters

This is a usage error. Reporting it as 93 means a CI job cannot distinguish "I forgot a flag" from "the endpoint is unreachable".

Suggested fix

Validate in parseAssertionFlags / the cobra Run before constructing the request, exit with the invalid-arguments code, and point at a remedy:

Error: no assertions specified; pass at least one --assert-* flag (e.g. --assert-ok)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions