Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

External task return error code

Hi,

I have an external task which suppose to do the following:

Batch file

- Check existence of file on DMZ server

If file exist, continue execution of dependent tasks

If file does not exist, exit with error. retry in 5 minutes

I'm using the following command to explicitly throw an error :

EXIT /B -1

In reality the tasks ends with warning instead of error and precedes with the rest of the tasks in the execution thread.

Any idea's ?

Greetings,

Dror

7 Replies
erichshiino
Partner - Master
Partner - Master

Hi,

This maybe a strange workaroud, but can you force an error with a non-existing command?

You could use:

Trace FILE NOT FOUND;

ERROR;

It will create an unknown statement error

Hope this helps,

Erich

Not applicable
Author

Erich hi,

If i place this statement in batch file and let it fired by external task, it does produce an error but trapped as a warning. All dependent task will still run.

Dror

erichshiino
Partner - Master
Partner - Master

Hi,

How do you check file existence?

Did you change the system variable ErrorMode?

Can you post your script here?

- Erich

Not applicable
Author

Erich hi,

the check file is happening inside a .bat file. If no file exist an error is returned. The QVS for some reason consider this as a warning and therefore all successive tasks will run as usual.

Dror

Not applicable
Author

This looks like very strange behaviour to me. 

To recreate the issue:

In a batch file (configured as an external task), force a non zero (error) return code:

EXIT /B -1

I would expect the task to have a failed status in the QDS, but as Dror points out, this exception is being caught and marked as a warning. 

4/11/2012 09:56:40.5524236          Warning          Process exited with non zero exit code: -1 at 4/11/2012 9:56:40 AM

4/11/2012 09:56:40.5524236          Information          Process exited with exit code: -1 at 4/11/2012 9:56:40 AM

This basically makes it impossible to perform error handling in the external tasks. 

Dror - did you get a resolution to this from QV support, or did you find a work around?

Not applicable
Author

QV support have confirmed this as a bug (34870).

Not applicable
Author

I have seen this new setting in QV11 on the external task configuration, so I presume it has been fixed (although I haven't tried it yet):

Task result handling

Ignore errors (non zero return codes)


I am using 11.2 SR2.