One Star

tFileDelete dosn't handle failures/errors despite optio"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 on error"
is not taken by the flow.
Kind regards,
Hilderich
5 REPLIES
Community Manager

Re: tFileDelete dosn't handle failures/errors despite optio"fail on error"

Hi Hilderich
Can you please upload a screenshot of your job deisgn? It will be helpful for us to understand your problem.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Seventeen Stars

Re: tFileDelete dosn't handle failures/errors despite optio"fail on error"

Hi shong, I have already explained, the check if the file is deleted unfortunately does not use the normal mechanism, you have to check a string from the STATUS return variable.
When I saw the necessary steps to check that my first reaction was "What the fuck...." I am very confident, this terrible way will be changed or extended in the near future. It is far from being OK.
The file delete component is a bit strange designed!
After delete the given file the success can only be seen by this check:
"File deleted.".equals((String) globalMap.get("tFileDelete_1_CURRENT_STATUS"))

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.
Community Manager

Re: tFileDelete dosn't handle failures/errors despite optio"fail on error"

Hi jlolling
I did not notice that the user have created two same topics due to our bad forum performance, and you have explained a solution in his another topic. For the bad forum performance issue, we have reported it to our IT team some days before and they are working on it.
Thanks!
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Seventeen Stars

Re: tFileDelete dosn't handle failures/errors despite optio"fail on error"

Yes, the double post are terrible at the moment. I hope your colleagues can fix that soon.
Community Manager

Re: tFileDelete dosn't handle failures/errors despite optio"fail on error"

Actually if have not seen any difference in the code for fail-on-error. Probably a bug.

jlolling, I test quickly the fail-on-error option of tFileDelete component with TOS4DI 5.4.1, and it works, when this option is checked, the job throws out the exception and dies if there occurs an error on tFileDelete such as the file does not exist, and it will trigger another subjob with OnsubjobError.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business