Skip to content

Commit 3a090ef

Browse files
unhappychoiceclaude
andcommitted
feat: add TreeSitterLanguageError support
- Add TreeSitterLanguageError variant to GitTypeError enum - Handle language error in game command error handling - Support tree-sitter parser creation errors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a85eb4f commit 3a090ef

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/cli/commands/game.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,8 @@ fn handle_game_error(e: GitTypeError) -> Result<()> {
9696
GitTypeError::WalkDirError(walk_error) => {
9797
panic!("Directory walk error: {}", walk_error);
9898
}
99+
GitTypeError::TreeSitterLanguageError(lang_error) => {
100+
panic!("Tree-sitter language error: {}", lang_error);
101+
}
99102
}
100103
}

src/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ pub enum GitTypeError {
3434

3535
#[error("Invalid repository format: {0}")]
3636
InvalidRepositoryFormat(String),
37+
38+
#[error("Tree-sitter language error: {0}")]
39+
TreeSitterLanguageError(#[from] tree_sitter::LanguageError),
3740
}
3841

3942
pub type Result<T> = std::result::Result<T, GitTypeError>;

0 commit comments

Comments
 (0)