Skip to content

feat(error-handling): Refactor error handling in site generation#334

Merged
rochacbruno merged 4 commits intomainfrom
feat/improve-error-handling
Aug 7, 2025
Merged

feat(error-handling): Refactor error handling in site generation#334
rochacbruno merged 4 commits intomainfrom
feat/improve-error-handling

Conversation

@rochacbruno
Copy link
Copy Markdown
Owner

This commit refactors the error handling in the site generation process to use Result instead of Option and unwrap().

  • The generate function in src/site.rs now returns a Result<(), Box>.
  • The rebuild closure in src/site.rs now returns a Result<(), Box>.
  • The get_latest_build_info function in src/site.rs now returns a Result<Option, std::io::Error>.
  • The main.rs file has been updated to handle the Result returned by site::generate.

This change makes the error handling more robust and prevents the application from panicking on unexpected errors.

This commit refactors the error handling in the site generation process to use Result instead of Option and unwrap().

- The generate function in src/site.rs now returns a Result<(), Box<dyn std::error::Error>>.
- The rebuild closure in src/site.rs now returns a Result<(), Box<dyn std::error::Error>>.
- The get_latest_build_info function in src/site.rs now returns a Result<Option<BuildInfo>, std::io::Error>.
- The main.rs file has been updated to handle the Result returned by site::generate.

This change makes the error handling more robust and prevents the application from panicking on unexpected errors.
@rochacbruno rochacbruno force-pushed the feat/improve-error-handling branch from f6f0aff to 42a0371 Compare August 7, 2025 21:25
@rochacbruno rochacbruno merged commit ff8fed1 into main Aug 7, 2025
3 checks passed
@rochacbruno rochacbruno deleted the feat/improve-error-handling branch August 7, 2025 21:34
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