commandlineparser / commandlineparser/commandline

Bad format doesn't contain a lot of info

オープン
#921 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C#
スター
4.8k
フォーク
478
PR マージ指標
30日以内にマージされた PR はありません

説明

**Describe the bug**
If a conversion in the constructor of a datatype throws an error, only a very generic error is available:

> Option 'some option' is defined with a bad format.

**To Reproduce**
* Have a property of type DirectoryInfo
* Supply bad character (mostly happens by accident)
* Get general error

**Expected behavior**
There are some options:
1. Add the used parameter to the BadFormatConversionError type so the bad formatted input string can be shown in the custom help callback.
2. Catch TargetInvocationException and add the inner exception to the BadFormatConversionError
3. Show a message with the message of the exception, especially when the exception is an ArgumentException.
It would then read something like 'Option 'i, input' is defined with "Invalid;Path" which is a bad format: Illegal characters in path.'

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。