You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we assume that every entry in the file, once blank lines and comments are removed, is either a pattern or a valid path. Patterns are expanded to paths while we are searching for extensions but paths are used directly.
Error handling for patterns seems pretty good: if no file is found matching it we log that fact but otherwise ignore it. For paths without wild cards, we throw if the directory or file is not found.
The error message given when a path is not found can be cryptic. For example, a file containing a comment in C# format (leading double slash) gave the message "Directory '' not found." Figuring this out took an inordinate amount of time, since the message didn't clearly point to the addins file.
Proposed resolution:
Check each non-pattern (entries with without *) for validity as a path. If an invallid entry is found, throw an exception immediately so that the extension may be removed or the file fixed.
Optionally, check each pattern as well by replacing each * with a valid name and validate that as a path. In this case, we may want to simply issue a warning, as the error won't necessarily lead to an exception. If possible, we should try to discriminate between errors which will cause an exception and those which will not.
Comments please?
The text was updated successfully, but these errors were encountered:
It looks like this will require some serious refactoring first and I think that this area of the code could use some cleanup anyway. I'll start on that path and see where it takes me.
Currently, we assume that every entry in the file, once blank lines and comments are removed, is either a pattern or a valid path. Patterns are expanded to paths while we are searching for extensions but paths are used directly.
Error handling for patterns seems pretty good: if no file is found matching it we log that fact but otherwise ignore it. For paths without wild cards, we throw if the directory or file is not found.
The error message given when a path is not found can be cryptic. For example, a file containing a comment in C# format (leading double slash) gave the message "Directory '' not found." Figuring this out took an inordinate amount of time, since the message didn't clearly point to the addins file.
Proposed resolution:
Comments please?
The text was updated successfully, but these errors were encountered: