Process exits 0 when it fails

Open Beginner friendly
#80 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
macos, swift
Domain
cli

Research direction

Start at macSubtitleOCR.run(), then trace saveResults and SRT.write, where the issue identifies swallowed errors. Read the Swift error handling and ExitCode usage around those paths. Done when failures are printed, returned as a nonzero exit status, and SRT and JSON write errors propagate.

Written by the indexing model from the issue text.

Description

bug

macSubtitleOCR.run() catches every error, prints it, and returns normally, so the exit status is 0. saveResults also uses try? for both SRT and JSON writing, and SRT.write swallows its own error. Scripts cannot tell a failed run from a successful one.

Fix: after printing, throw ExitCode.failure; propagate write errors instead of swallowing them.

Dominant language
Swift
Stars
42
Forks
9
Avg merge
9h 30m
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ecdye/macSubtitleOCR

All issues in ecdye/macSubtitleOCR

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.