feat: 例外ベースエラーハンドリングアーキテクチャの完全導入#14
Closed
ogrew wants to merge 4 commits into
Closed
Conversation
### 新機能 - カスタム例外クラス(condition)システムを導入 - 構造化されたエラー情報とエラー階層を実装 - テスト可能なエラーケースの基盤を構築 ### 実装内容 #### 例外クラス (src/exceptions.lisp) - `visp-error`: ベースエラークラス - `visp-validation-error`: バリデーションエラー - `visp-option-error`: オプションエラー - `visp-file-error`: ファイルエラー - `visp-ffmpeg-error`: FFmpeg実行エラー #### ヘルパー関数 - `error-option`, `error-file`, `error-validation`, `error-ffmpeg` - 簡潔な例外発生のためのユーティリティ #### 試験実装 - `validate-speed`関数を例外ベースに変更 - `(uiop:quit 1)` → `error-option`への置換 - 新しいエラーケーステストを追加 ### テスト改善 - 例外クラスの包括的テスト (t/test-exceptions.lisp) - validate-speedのエラーケーステスト追加 - 例外階層の正しい継承関係を検証 ### 期待される効果 - テスト可能なエラーハンドリング - より詳細なエラー情報 - 段階的な例外ベース移行の基盤 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
### main.lispの改善 - 包括的な例外ハンドリングシステムを追加 - `visp-validation-error`, `visp-ffmpeg-error`, `visp-error`の階層的ハンドリング - 詳細なエラーメッセージとffmpegコマンド情報の表示 - 予期しないエラーのハンドリング ### validate関数の例外ベース化 #### validate-speed ✅ - `(uiop:quit 1)` → `error-option`に変更 - 詳細なコンテキスト情報を含むエラー #### validate-input ✅ - ファイル/ディレクトリ存在チェックを例外ベース化 - `error-file`を使用したファイルシステムエラー - `error-option`を使用したオプションエラー #### validate-reverse ✅ - オプション競合チェックを例外ベース化 - 拡張子制限チェックを例外ベース化 ### 利点 - テスト可能なエラーケース - 構造化されたエラー情報 - 一貫したエラーハンドリング - 段階的移行による安全性 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
### validate関数の例外ベース化 #### validate-repeat ✅ - `--loop`オプションの整数値バリデーション - `(uiop:quit 1)` → `error-option` #### validate-resolution ✅ - `--res`と`--half`の排他チェック - 無効な解像度の検出 #### validate-half ✅ - ffprobeからの解像度取得失敗時の処理 #### validate-fps ✅ - `--fps`オプションの正整数バリデーション ### エラーケーステスト大幅拡充 #### 新しいテストスイート(20新規テストケース) - `validate-input-error-tests`: 入力ファイル/ディレクトリエラー - `validate-reverse-error-tests`: リバースオプションエラー - `validate-repeat-error-tests`: ループオプションエラー - `validate-resolution-error-tests`: 解像度オプションエラー - `validate-fps-error-tests`: FPSオプションエラー ### テスト改善効果 - **Before**: 成功ケースのみ、エラーケース0個 - **After**: 包括的なエラーケーステスト、20個追加 - テスト可能になったエラーパターン: - 存在しないファイル/ディレクトリ - オプション競合(--reverse + --loop) - 無効な数値(負数、非数値) - サポートされていない解像度 - 拡張子制限違反 ### アーキテクチャ改善 - プロセス終了方式から例外ベース方式への完全移行 - テスト可能なエラーハンドリング - 構造化されたエラー情報 - より堅牢で保守性の高いコード 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- validate-gif-mode, validate-merge-files, validate-codec, validate-output, validate-monoを例外ベース化 - 全validate関数でuiop:quitパターンを削除し、適切な例外クラスでエラー報告 - 包括的なエラーケーステストを追加(20+の新テストケース) - visp.asdにファイル依存関係を追加してコンパイル順序を改善 - CLAUDE.md完了タスクの削除と残存タスクの再整理 これでVispプロジェクトの全validate関数が例外ベース化され、 プロセス終了を伴わない構造化されたエラーハンドリングが完成。 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
VispプロジェクトのエラーハンドリングアーキテクチャをProcess Exit方式から Exception-based方式に完全移行しました。
主要変更点
(uiop:quit 1)から例外throwing方式に変更技術的改善
影響範囲
Test plan
🤖 Generated with Claude Code