Skip to content

[Hackathon] invalid --since and missing --password-file crash instead of returning VALIDATION_ERROR #79

Description

@crypticsaiyan

Discord Username / User ID

uisupersaiyan3

What does this improvement do?

Summary

Two categories of invalid user input currently produce unhandled exceptions
(raw Node stack traces, exit code 1) instead of the CLI's standard typed
validation error (exit code 5):

  1. An extremely large --since duration overflows the valid JavaScript date
    range and crashes during date conversion.
  2. A non-existent --password-file path during project creation or update
    crashes with an unguarded filesystem error.
    In both cases, input that a user could plausibly supply by mistake bypasses
    the CLI's validation-error handling entirely and surfaces as an
    unhandled exception instead.

Affected Code

File Function Issue
src/commands/test.ts parseDuration No bounds check on the parsed date before calling .toISOString()
src/commands/project.ts Password file handling (create/update) readFileSync call is unguarded; missing file throws raw ENOENT

Details / implementation notes

issue fixed in PR #27

Confirmations

  • I have searched existing issues and this is not a duplicate.
  • I have provided my Discord identity above for reward coordination.

Metadata

Metadata

Labels

hackathonCLI hackathon submissionsin-progressAssigned and actively being worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions