Skip to content

refactor: エラーハンドリングを thiserror に統一 - #21

Merged
pranc1ngpegasus merged 1 commit into
mainfrom
cursor/unify-thiserror-errors-1a13
May 28, 2026
Merged

refactor: エラーハンドリングを thiserror に統一#21
pranc1ngpegasus merged 1 commit into
mainfrom
cursor/unify-thiserror-errors-1a13

Conversation

@pranc1ngpegasus

Copy link
Copy Markdown
Member

概要

ワークスペース全体のエラー型を thiserror に揃え、文字列や unit 型 (()) による ad-hoc なエラー表現を廃止しました。

変更内容

wisp-core

  • SourceLabelError を追加し、SourceLabelFromStrErr 型として利用
  • thiserror を依存関係に追加

wisp-storage

  • StorageError::UnknownSourceStorageError::SourceLabel(#[from] SourceLabelError) に置き換え(#[error(transparent)]
  • セグメント読み込み時のパースを ? で簡潔化

wisp-audiokit

  • SessionErrorerror.rs に集約(macOS / 非 macOS のバリアントは cfg で切り替え)
  • SessionErrorClone を付与(UI 層での保持に必要)

wisp-desktop

  • Update::ErrorAppModel::last_errorString から SessionError に変更
  • セッション開始失敗時に to_string() で型情報を失わないように修正

テスト

  • cargo test -p wisp-core -p wisp-storage -p wisp-audiokit — 全テスト合格
  • cargo check -p wisp-desktop — コンパイル成功
Open in Web Open in Cursor 

- 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>
@pranc1ngpegasus
pranc1ngpegasus marked this pull request as ready for review May 28, 2026 14:05
@pranc1ngpegasus
pranc1ngpegasus merged commit 7b656b2 into main May 28, 2026
2 checks passed
@pranc1ngpegasus
pranc1ngpegasus deleted the cursor/unify-thiserror-errors-1a13 branch May 28, 2026 14:05
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.

2 participants