BerndK / SvgToXaml

Smart Tool to view svg-files and convert them to xaml for use in .NET
Other
886 stars 164 forks source link

Hard to decipher error when input folder is missing on BuildDict #25

Closed poisonborz closed 3 years ago

poisonborz commented 3 years ago

When invoking from command line using BuildDict, without the inputdir folder present, the result is:

Error Handling Commandline:
[TargetInvocationException] Exception has been thrown by the target of an invocation.
  [DirectoryNotFoundException] Could not find a part of the path 'H:\Table\SvgToXaml\svg\images.html'.

----Stacktrace----
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)

Instead of a simple "input folder is missing". I think stacktraces should also be hidden if not in some debug mode.

BerndK commented 3 years ago

There is an additional check if you don't provide the inputdir parameter at all. You are right, there is no extra check for an incorrect setting for inputdir, the tool just shows all problems (exceptions) that may occur here. The tool is developed for developers, not for end users. I'm sure that you quickly found the problem when reading the message. In case this is not acceptable for your use case, you are free to create a fork and modify the behavior to fulfill your needs.