Skip to content

How to send an email from the "On Error" panel in a project

View some of the Frequently Asked Questions to our support staff. Included are some tips and tricks making this forum ideal for users getting started with GoAnywhere MFT, Gateway, Agents, etc.
Note: Users can reply to existing topics but only our support staff can add new topics to this forum.
  • User avatar
  • Support_Hans Offline
  • Fortra Employee
  • Posts: 10
  • Joined: Mon Jul 22, 2019 11:32 am

How to send an email from the "On Error" panel in a project

Post by Support_Hans »

Overview
Technically, you cannot execute another task from the On Error panel. You can, however, trigger the execution of a Module or trap the error and execute tasks based on the results of the error.


Environment
GoAnywhere MFT - all versions


Resolution/Implementation
First, add a new Module to your project. Give it a unique name.

Module:

Image


Second, add tasks to the new Error Module that you would like executed when the error happens. This could be sending an email, copying a file, deleting a file, basically… whatever you want to accomplish based on the Error happening.

Image


Next, go back to the task and expand the On Error panel. Select the "call:[module]" option and replace the [module] with the name of the Module you created above.

Image


Now, during execution of your project, when an error happens during the execution of that task, control will be transferred to the Module defined in the On Error panel, and execution will continue from that point. This means, sending emails or whatever group of tasks you have defined in the Error Module.

Set Variable:

Using this outline, it shows the steps for this error logic.

Image



First, create an error variable and initialize it to "false" (See "setVar: sftpError" above)

Image


Next, setup the task you want to check for errors. In this example, we are wanting to make sure that a file is successfully SFTP'd to the client. Define the On Error panel to "setVariable" and have it change the "sftpError" variable defined prior if there is an error during the transfer of the file.

Image


Then, condition the next step to execute only if there was an error during the transfer of the file.

*NOTE* the variable sftpError will only be changed to "false" if there were issues during the file transfer. Otherwise, it will remain "true".

Image


In that IF statement, perform any tasks (like you did in the Module above).

Image
Hans Espiritu (he/him)
Senior Support Analyst

Toll free: +1 800 949-4696
Phone: +1 402 944-4242