FTP Error Handling

  • Hi All,

    I have a FTP Task to get files from a remote server. If the files are not in the server the task fails which is fine. I want to have an error handling to send an email if the ftp connection fails due to some network issue. it should not sent me an emaill if the files are not in the remote folder.

    I tried using an event handler on the ftp task but it will send me an email even if the files are not present.

    Can any1 help me please.

  • Hi,

    The age old problem...

    Within the event handler environment a number of extra variables are made available. Some of these are to do with errors...

    You could possibly (i've never done it)....

    * Create an OnError event handler for your FTP task

    * Drop in a Script Task

    * Connect it to your Email task

    * Create a variable "sendmail" with type int32

    * Double click your connecting line and change operation to expression and constraint

    In the expression field put @sendmail == 1

    Now your email task will only fire if sendmail is equal to 1. We now need to set sendmail = to 1 or 0 using the script task.

    Within the event handler environment open up the variables list, at the top you should see a grey square containing an X, click on it.

    These are all system variables and you should see a couple relating to errors, feed these into the script task and use them to determine whether or not it's an error you want to result in an email and set the sendmail variable to 1 or 0 accordingly.

  • Thanks chris!

  • 0

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply