Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Guest
2011-02-08T16:56:06Z
We are currently running several script (windows host/script files) through VisualCron. When an error happens in the script file we want to communicate back to VisualCron that the task has failed and specify the error message. How can we accomplish this?
Sponsor
Forum information
Support
2011-02-08T20:52:55Z
What kind of scripting language? VBScript? Bat files?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Guest
2011-02-09T14:37:01Z
We are using VBScript files.
Support
2011-02-09T16:46:39Z
You could use:

wscript.quit(1)

You can probably also use:

Err.Raise 1

http://stackoverflow.com...row-an-error-in-vbscript 

Replace 1 with any exit code. VisualCron captures the exit code. Any other exit code than 0 is a failure. VisualCron uses standard Windows exit code descriptions located in an xml file called ExitCodes.xml.

But you could print any info to standard out or standard error using:

WScript.StdOut.Write("Output text")
WScript.StdErr.Write("Error text")
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Guest
2011-02-28T14:50:58Z
VisualCron doesn't seem to capture error when I execute:

WScript.StdErr.Write("custom error message")

Use exit codes is not an option as we want to log specific custom error messages about the details of the error and not predefined errors. Is there no way to set the task status to failed and add a reason through the API?
matrixIII
2011-03-03T21:28:30Z
You can do...

WScript.StdErr.Write("custom error message")
wscript.quit(1)

Then the 'Result' will say "Failed", 'Output' or 'Output (stderr)' will show your error description (you can double click if it's more than one line).

'Result' will have the predefined error. You can live with it 🙂 or probably create additional lines in the xml file that has all the standard error messages defined. Start from 20000. I think VisualCron uses the xml file to get its descriptions but then you run the risk that this file may be overridden with new releases.

LEikelman wrote:

VisualCron doesn't seem to capture error when I execute:

WScript.StdErr.Write("custom error message")

Use exit codes is not an option as we want to log specific custom error messages about the details of the error and not predefined errors. Is there no way to set the task status to failed and add a reason through the API?


Guest
2011-03-03T22:02:55Z
I can see the custom message in the result column, but if the job runs again it overwrites the result message. Using the "Retrieve Log" function in VisualCron doesn't display the custom error message. Where would I go to retrieve the logged custom error messages in stderr?

Support
2011-03-04T05:34:39Z
One way is to write the output to file or send an email after each run. But we are also developing a historic tool for output which hopefully will be ready soon.

LEikelman wrote:

I can see the custom message in the result column, but if the job runs again it overwrites the result message. Using the "Retrieve Log" function in VisualCron doesn't display the custom error message. Where would I go to retrieve the logged custom error messages in stderr?



Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top