Skip to content

Conversation

@vagmcs
Copy link
Owner

@vagmcs vagmcs commented Aug 6, 2025

This PR implements issue #15 by migrating from manual error implementations to using the thiserror crate for improved error handling.

Changes

  • Added thiserror = "1.0" dependency to Cargo.toml
  • Refactored MDPError in src/mdp/model.rs to use thiserror's #[derive(Error)] macro
  • Replaced manual Error and Display trait implementations with #[error] attributes
  • Removed unused imports (std::error::Error, std::fmt)

Benefits

  • Cleaner, more maintainable error definitions
  • Automatic Error and Display trait implementations
  • Consistent error message formatting
  • Reduced boilerplate code

The existing tests continue to pass, ensuring backward compatibility is maintained.

@github-actions github-actions bot added the invalid The PR title doesn't seem right label Aug 6, 2025
@vagmcs vagmcs changed the title Derive Error using thiserror crate refactor: Derive Error using thiserror crate Aug 6, 2025
@github-actions github-actions bot added refactor Refactors or improves code, but neither fixes a bug nor introduces a new feature and removed invalid The PR title doesn't seem right labels Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactors or improves code, but neither fixes a bug nor introduces a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants