Skip to content

cli: invalid --timeout values raise a raw parser exception #2866

@kuishou68

Description

@kuishou68

Summary

Passing a non-numeric timeout to the CLI currently raises a raw ValueError from float(value) instead of surfacing an argparse validation error.

Reproduction

sherlock --timeout abc testuser

Current behavior

The CLI blows up while parsing arguments instead of reporting a normal argument --timeout: ... validation error.

Expected behavior

Invalid timeout inputs should consistently be converted into ArgumentTypeError, just like zero or negative values already are, so argparse can render a clean user-facing error message.

Proposed fix

Wrap the float(value) conversion in timeout_check() and re-raise invalid inputs as ArgumentTypeError, then add a regression test for invalid timeout values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions