設定ファイル読み込み失敗時の例外メッセージとスタックトレースを出力するように改善#300
Open
kh813 wants to merge 1 commit into
Open
Conversation
Up to standards ✅🟢 Issues
|
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)
設定ファイル( system_setting.ps1 / user_setting.ps1 )の読み込み(ドットソース読み込み)でエラーが発生した際、具体的な例外内容とエラーが発生した行番号(スタックトレース)をコンソールに出力するように改善しました。
背景と目的 (Motivation)
現行の挙動では、設定ファイル内でタイポや未定義変数の参照、文字コードの不整合などによる構文エラーが発生した場合、単に「ユーザ設定ファイルの読み込みに失敗しました」(または「システム設定ファイルの読み込みに失敗しました」)とだけ表示されて強制終了していました。
これでは「設定ファイルの何行目で、何が原因でエラーになっているのか」がユーザー側で分からず、トラブルシューティングが困難になっていました。特にGUI設定画面が使えないMacやLinuxなどのCUI環境において、この問題が初期セットアップのハードルを上げていました。
この変更により、エラー発生時に以下のように具体的な行番号とエラー理由が赤字で出力されるため、ユーザー自身での解決が容易になります。
出力例(user_setting.ps1の468行目でエラーが起きた場合):