Skip to content

CLI commands crash with unhandled ParseError on malformed input #10

@dithesh12

Description

@dithesh12

Summary

CLI commands (parse and validate) crash with an unhandled ParseError when processing malformed or truncated input files. Instead of handling the error gracefully, the application terminates with a full Python traceback.

This contradicts the framework’s goal of handling malformed and truncated telemetry streams.


Reproduction

  1. Copy a valid sample file:
    copy samples\valid_telemetry.sgf broken.sgf

  2. Open broken.sgf and delete part of the second frame (truncate the file)

  3. Run:
    python -m sigflow parse broken.sgf

  4. Observe the CLI crashes with a traceback

  5. Repeat:
    python -m sigflow validate broken.sgf


Expected Behavior

The CLI should handle malformed or truncated input gracefully and display a structured error message (e.g., "truncated input at offset X") instead of crashing with a full traceback.


Actual Behavior

The CLI crashes with an unhandled exception:

sigflow.core.exceptions.ParseError: truncated input

A full Python traceback is displayed instead of a user-friendly error message.


Environment

  • Python version: 3.13.2
  • sigflow version or commit: 0.1.0 (local install from repository)
  • Operating system: Windows 10

Additional Context

The error originates from sigflow/parsers/base.py where ParseError is raised when truncated input is detected.

However, CLI commands in sigflow/cli/commands.py (specifically parse_command and validate_command) do not catch this exception, allowing it to propagate and terminate the program.

This makes the CLI tools less robust for real-world telemetry pipelines where malformed inputs are expected.

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