Return Code Variable for Native Command

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
2 posts Page 1 of 1


Posts: 5
Joined: Fri Nov 08, 2013 11:20 am

Post by kgould » Sun Aug 23, 2015 12:47 am
If I set the Return Code Variable in a Native Command task and the task is set to call a module if the program errors I am seeing a value of 0 in the variable but the log is showing a return code of the number I passed back from the executable. Is this by design? To get the return code in the variable do I have to have the task not route to my error module (On Error), but test for a value other than 0 in the return code variable and then call my error module?

Thank you


Support Specialist
Posts: 592
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Mon Aug 24, 2015 1:25 pm
Your best bet in this situation is to do just that ...

Test your return code (ie, you're defining an error, not the system) then execute accordingly.

Remember, the OnError will set based on there being an issue with the execution of the task. If you're telling it there's an error (based on some value or generated return code) and the task is still executing as designed, then the OnError wouldn't trigger in this case.

Immediately following the exec task, put a condition to test the return value and then call the Error Module from there if indicated.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
2 posts Page 1 of 1