Skip to content

fix: improve error messages for invalid API requests #416

@vivianamarquez

Description

@vivianamarquez

When an invalid ID is passed to a command (e.g. prolific study view badid), the CLI dumps the raw API response body as the error message, which can be hundreds of lines of unformatted text.

Expected behavior: a short, human-readable message like "resource not found" or "request failed with status 404".

This affects all commands since the error handling is in the shared Execute method in client/client.go — any 4xx response with an unrecognized error format gets its full body printed.

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