Skip to content

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.
  • kgould Offline
  • Posts: 5
  • Joined: Fri Nov 08, 2013 11:20 am

Return Code Variable for Native Command

Post by kgould »

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_Rick Offline
  • Support Specialist
  • Posts: 590
  • Joined: Tue Jul 17, 2012 2:12 pm
  • Location: Phoenix, AZ
  • Contact:

Re: Return Code Variable for Native Command

Post by Support_Rick »

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
Post Reply