refactor: replace process::exit with ExitCode#13
Merged
Conversation
There was a problem hiding this comment.
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.
Deploying pratrol with
|
| 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 |
4a707c2 to
3898906
Compare
3898906 to
5896783
Compare
There was a problem hiding this comment.
🤖 Code Review
Assessment ✅
Clean, idiomatic refactor. No correctness, security, or data loss issues.
AppErrorwith#[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 inrun()is correct — destructors run before exit, unlikeprocess::exit.- The new
src/error.rsmodule is minimal and appropriate.
Note
Tag @mendral-app with feedback or questions. View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Replaces all
std::process::exit(1)calls with idiomatic RustExitCodeby extracting application logic into arun()function returningResult<(), AppError>, and introducing a newsrc/error.rsmodule with athiserror-derivedAppErrorenum covering config, GitHub, Mistral, and I/O errors.Written by Mendral for commit 5896783.