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

Gaulois raise Exception InvalidSyntax when folder does not exists #37

Open
karrayhamdi opened this issue Feb 13, 2018 · 1 comment
Open

Comments

@karrayhamdi
Copy link

Hi,

when i run a gaulois pipe on an non existing folder source, il get the following Exception :

Caused by: fr.efl.chaine.xslt.InvalidSyntaxException: D:\data\output\prepare is not a valid directory
at fr.efl.chaine.xslt.config.ConfigUtil.buildFolderContent(ConfigUtil.java:503)
at fr.efl.chaine.xslt.config.ConfigUtil.buildSources(ConfigUtil.java:282)
at fr.efl.chaine.xslt.config.ConfigUtil.buildConfig(ConfigUtil.java:186)
at com.processing.step.GauloisPipeStep.run(GauloisPipeStep.java:93)
... 8 more
The syntax is correct. I think the best way is simply to consider 0 file as source, with no exception thrown .

For example, i run 2 gaulois, the first one for filtring files and the second one to do some thing else with filtred files. If all files are filtred on the first gaulois pipe, my seconf gaulois pipe raise an Exception.

thanks

@cmarchand
Copy link
Owner

I think raising an exception to user is a good thing ; hence, user knows he has given a wrong configuration. If no exception was raised, he couldn't know he made a mistake, and can only think there is no file.

So, my opinion is we should keep the current behavior.

But, you are right, we should also be tolerant, for the case you mention.

What about adding an attribute to precise the behavior ? Something like :

    <sources>
        <folder href="..." recurse="true" pattern=".*\.xml" raiseFnfEx="false"/>
    </sources>

@raiseFnfEx has a default value of true, and if true, has the current behavior ; if false, FileNotFoundException is not raised, and 0 files are found.

What's your feeling ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants