Skip to content

Bug: rtk json on non-JSON files gives obscure error #347

@pszymkowiak

Description

@pszymkowiak

Description

rtk json Cargo.toml fails with Failed to parse JSON / expected value at line 1 column 2. The error should indicate the file is not JSON.

Reproduction

rtk json Cargo.toml
# Error: Failed to parse JSON
# Caused by: expected value at line 1 column 2

Expected behavior

A clear error message like: Error: Cargo.toml is not a JSON file (detected TOML)

Suggestion

Detect file extension and suggest rtk deps for Cargo.toml or rtk read for other formats.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions