Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: DisplayableErrorを追加し、テストも追加する #2559

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Hiroshiba
Copy link
Member

@Hiroshiba Hiroshiba commented Feb 24, 2025

内容

errorToMessageを改造し、
DisplayableError以外のエラーは(内部エラーメッセージ)として、
DisplayableErrorのエラーはユーザー向けのメッセージとして文字列化するようにします。

ついでにAggregateErrorやcauseなどもメッセージ化できるようにします。

の改造版で、DisplayableErrorも追加します。

関連 Issue

ref #2556

その他

都合が良かったのでerrorToMessagesも作りました。
IPC通信を通すときはこっちを使い、displayableなものとinternalなものを分離してシリアライズ化して通信し、new DisplayableError(displayable, { cause: new Error(internal) })とする予定です。

ちなみにDisplayableError以外の名前を検討したけど良いのが見つかりませんでした。
AIくんはUserError推しだけど、これだとユーザー入力のエラーに見える。。
https://chatgpt.com/share/67bc5a21-71d0-8008-9711-c532c1d300b3
https://x.com/i/grok/share/bNQSK5cxxKMj7M2OvYcZbSZUn

@Hiroshiba Hiroshiba requested a review from a team as a code owner February 24, 2025 14:07
@voicevox-preview-pages
Copy link

voicevox-preview-pages bot commented Feb 24, 2025

🚀 プレビュー用ページを作成しました 🚀

更新時点でのコミットハッシュ:44afe46

@Hiroshiba
Copy link
Member Author

@sevenc-nanashi だいぶややこしくなってしまったけど。。。どうでしょう。。。

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.

1 participant