commandlineparser / commandlineparser/commandline
Bad format doesn't contain a lot of info
- Vorherrschende Sprache
- C#
- Sterne
- 4.8k
- Forks
- 478
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
**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.'
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Verfolge den Konvertierungspfad des Konstruktors für eine DirectoryInfo-Option und die im Issue beschriebene Behandlung von BadFormatConversionError. Bestimme zunächst, welchen der drei vorgeschlagenen Ansätze zur Fehlerberichterstattung die Maintainer wünschen, und überprüfe dann, wie die fehlerhafte Eingabe und die zugrunde liegende Ausnahme den benutzerdefinierten Help-Callback erreichen können. Als erledigt gilt dies, wenn das ausgewählte Verhalten nützliche Formatdetails statt nur der generischen Meldung meldet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- cli
- Issue-Typ
- Bug
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 30/100