tFileDelete dosn't handle failures/errors despite fail on error
Dear Readers,
In our Talend Job there is a tFileDelete component that cleans the content of a directory.
However we need handle the case when at least one file could not be deleted.
When the job executes all files but not the locked ones are deleted. These circumstance
should trigger the mechanism "fail on error" but it is not. The link to "on subjob error"
is not taken by the flow.
Kind regards,
Hilderich
Do you get failure message in your component though it continues running? You can add a tAssert and a tAssertCatcher to check for this condition and connect it to a tDie to force a kill.
This boolean expression can be used in the if trigger.
For me this component is very bad designed. Why they do not have added a usable return value like DELETE_OK or let the component die if it does not work.
Actually if have not seen any difference in the code for fail-on-error. Probably a bug.
Hello All,
We have solved it by Apache's commons-io in particular with
org.apache.commons.io.FileUtils.cleanDirectory enclosed in tJava.
Kind regards,
Hilderich