11. Error handling and exit code mapping #13

Closed
opened 2026-05-20 15:31:42 -06:00 by ppreeper · 0 comments
Owner

Description

Implement comprehensive error handling with wkhtmltopdf-compatible exit codes.

Tasks

  • Implement exit code mapping:
    • 0: Success
    • 1: PDF generated with warnings
    • 2: Memory error / Chrome crash
    • 3: Timeout
    • 4: Input file not found
    • 5: Output file error (can't write PDF)
    • 6: Chrome binary not found
    • 7: Invalid arguments
  • All error messages to stderr
  • Include wrapper version in startup banner (unless --quiet)
  • Prefix wrapper messages to distinguish from Chrome output
  • --quiet suppresses all non-error output

Acceptance Criteria

  • Each error condition produces correct exit code
  • Error messages clear and actionable
  • Startup banner shows version (e.g., "wkhtmltopdf 0.1.0")
  • --quiet suppresses banner and warnings, shows only errors
  • Output file write failure → exit code 5

Notes

  • Relates to PRD #2
## Description Implement comprehensive error handling with wkhtmltopdf-compatible exit codes. ## Tasks - [ ] Implement exit code mapping: - 0: Success - 1: PDF generated with warnings - 2: Memory error / Chrome crash - 3: Timeout - 4: Input file not found - 5: Output file error (can't write PDF) - 6: Chrome binary not found - 7: Invalid arguments - [ ] All error messages to stderr - [ ] Include wrapper version in startup banner (unless `--quiet`) - [ ] Prefix wrapper messages to distinguish from Chrome output - [ ] `--quiet` suppresses all non-error output ## Acceptance Criteria - Each error condition produces correct exit code - Error messages clear and actionable - Startup banner shows version (e.g., "wkhtmltopdf 0.1.0") - `--quiet` suppresses banner and warnings, shows only errors - Output file write failure → exit code 5 ## Notes - Relates to PRD #2
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ppreeper/wkhtmltopdf#13
No description provided.