Skip to content

Invalid --url / NSC_URL crashes with an internal error #186

Closed

Description

@thomaschristory

resolve_profile builds HttpUrl(url) without catching the pydantic ValidationError, so a malformed URL escapes as an internal error with a traceback instead of a usage/config error.

Repro

NSC_TOKEN=x nsc --url not-a-url dcim sites list

→ {"error":"internal error: 1 validation error for function-wrap[wrap_val()] Input should be a valid URL…", a traceback, exit 1.

Expected: exit 2, invalid NetBox URL 'not-a-url' (from --url), the same shape as the #179 fix. NSC_SCHEMA/--schema URLs probably need the same treatment.

Found in the adversarial review of #185.

Activity

  1. thomaschristory commented on Oct 23, 2026

    @thomaschristory
    OwnerAuthor

    Claiming: branch fix/invalid-url-usage-error.

  2. thomaschristory commented on Oct 23, 2026

    @thomaschristory
    OwnerAuthor

    PR opened: #188. It also fixes static commands exiting silently on bootstrap errors.

  3. thomaschristory commented on Oct 23, 2026

    @thomaschristory
    OwnerAuthor

    Done: merged in #188 and released in v1.8.4. Follow-up: #189.

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