Skip to content

fix: Database connections now close cleanly when a command exits on an error - #155

Merged
DylanDevelops merged 4 commits into
mainfrom
ravel/os.exit(1)-improvements
Jul 20, 2026
Merged

fix: Database connections now close cleanly when a command exits on an error#155
DylanDevelops merged 4 commits into
mainfrom
ravel/os.exit(1)-improvements

Conversation

@DylanDevelops

Copy link
Copy Markdown
Owner

Pull Request Checklist

  • I have read and followed the contribution guidelines.
  • My pull request targets the main branch of tmpo.
  • I have tested these changes locally on my machine.

Closes #143

Description

Refactored all commands to use RunE() instead of Run() which allows for custom error handling. This is especially useful when interfacing with the database to secure defer db.close() statements.

@DylanDevelops
DylanDevelops merged commit c48ea7d into main Jul 20, 2026
5 checks passed
@DylanDevelops
DylanDevelops deleted the ravel/os.exit(1)-improvements branch July 20, 2026 19:23
@DylanDevelops DylanDevelops added the type: fix A pull request that fixes a bug (fix:) label Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix A pull request that fixes a bug (fix:)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

os.Exit inside Run bypasses deferred database closures

1 participant