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

Bad format doesn't contain a lot of info #921

Open
labsin opened this issue Mar 1, 2024 · 2 comments
Open

Bad format doesn't contain a lot of info #921

labsin opened this issue Mar 1, 2024 · 2 comments

Comments

@labsin
Copy link

labsin commented Mar 1, 2024

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.'
@labsin
Copy link
Author

labsin commented Mar 1, 2024

Relates to #113

@labsin
Copy link
Author

labsin commented Mar 1, 2024

BTW, the initial problem was #226, which I had to debug to see the actual thing that went wrong.

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

No branches or pull requests

1 participant