Skip to content

refactor: replace process::exit with ExitCode#13

Merged
ymelois merged 1 commit into
mainfrom
refactor/use-exit-code-result
Mar 1, 2026
Merged

refactor: replace process::exit with ExitCode#13
ymelois merged 1 commit into
mainfrom
refactor/use-exit-code-result

Conversation

@ymelois
Copy link
Copy Markdown
Contributor

@ymelois ymelois commented Mar 1, 2026


Note

Replaces all std::process::exit(1) calls with idiomatic Rust ExitCode by extracting application logic into a run() function returning Result<(), AppError>, and introducing a new src/error.rs module with a thiserror-derived AppError enum covering config, GitHub, Mistral, and I/O errors.

Written by Mendral for commit 5896783.

Copy link
Copy Markdown

@pratrol pratrol Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pratrol Triage Brief: 🟢 High Confidence

Pratrol assessed this pull request across the primary risk vectors below.

Risk Vector Score Tier
Contributor Context 69/100 🟡 Medium
Logic Risk (Mistral) 86/100 🟢 High
Overall Confidence 79/100 🟢 High

Summary: Refactored the main function to use ExitCode instead of process::exit for better error handling.

Key Signal: The refactoring improves error handling and code structure.

Recommendation: Review the changes for any potential edge cases in error handling.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 1, 2026

Deploying pratrol with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5896783
Status: ✅  Deploy successful!
Preview URL: https://9fc73e64.pratrol.pages.dev
Branch Preview URL: https://refactor-use-exit-code-resul.pratrol.pages.dev

View logs

mendral-app[bot]

This comment was marked as outdated.

@ymelois ymelois force-pushed the refactor/use-exit-code-result branch from 4a707c2 to 3898906 Compare March 1, 2026 11:33
@ymelois ymelois force-pushed the refactor/use-exit-code-result branch from 3898906 to 5896783 Compare March 1, 2026 11:34
Copy link
Copy Markdown

@mendral-app mendral-app Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Code Review

Assessment ✅

Clean, idiomatic refactor. No correctness, security, or data loss issues.

  • AppError with #[error(transparent)] correctly preserves underlying error messages through the display chain, so operators still see meaningful error text in the single "Fatal error." log line.
  • ? propagation in run() is correct — destructors run before exit, unlike process::exit.
  • The new src/error.rs module is minimal and appropriate.

Note

Tag @mendral-app with feedback or questions. View session

@ymelois ymelois merged commit 476d537 into main Mar 1, 2026
6 checks passed
@ymelois ymelois deleted the refactor/use-exit-code-result branch March 1, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant