refactor: エラーハンドリングを thiserror に統一 - #21
Merged
Merged
Conversation
- Add SourceLabelError in wisp-core for FromStr parsing - Replace StorageError::UnknownSource with transparent SourceLabel variant - Extract SessionError into wisp-audiokit/error.rs (cfg-gated variants) - Propagate SessionError through desktop session runner instead of String Co-authored-by: Fukaya Temma <pranc1ngpegasus@users.noreply.github.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.
概要
ワークスペース全体のエラー型を
thiserrorに揃え、文字列や unit 型 (()) による ad-hoc なエラー表現を廃止しました。変更内容
wisp-coreSourceLabelErrorを追加し、SourceLabelのFromStrのErr型として利用thiserrorを依存関係に追加wisp-storageStorageError::UnknownSourceをStorageError::SourceLabel(#[from] SourceLabelError)に置き換え(#[error(transparent)])?で簡潔化wisp-audiokitSessionErrorをerror.rsに集約(macOS / 非 macOS のバリアントはcfgで切り替え)SessionErrorにCloneを付与(UI 層での保持に必要)wisp-desktopUpdate::ErrorとAppModel::last_errorをStringからSessionErrorに変更to_string()で型情報を失わないように修正テスト
cargo test -p wisp-core -p wisp-storage -p wisp-audiokit— 全テスト合格cargo check -p wisp-desktop— コンパイル成功