SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Bug in Error handling?

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Bug in Error handling?
Author Message
Eric



Joined: 10 Jan 2005
Posts: 15

Post Bug in Error handling? Reply with quote

I am trying to throw errors to my custom error handling scripts (basically keep 24x7 erros but log to a file as well)

I state OnErrorResumeNext..

my current error is w/ a file copy... it returns a boolean false.

I then call my custom script to do:

LogAddMessageEx "ERROR", @V"job_id", "@V"job_name"", error

where error is my error message.

This does NOT write to the 24x7 log at all.

Since I want the script to also stop processing, I added a OnErrorStop within my custom script... but this seems to be ignored.

is there anyway I can have BOTH 24x7 log the error & stop AND have some custom error functionality ?

Mon Jan 10, 2005 12:01 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Bug in Error handling? Reply with quote

Are you sure LogAddMessageEx is executed?
Can you post the entire script or script trace file?

: I am trying to throw errors to my custom error handling scripts (basically
: keep 24x7 erros but log to a file as well)

: I state OnErrorResumeNext..

: my current error is w/ a file copy... it returns a boolean false.

: I then call my custom script to do: LogAddMessageEx "ERROR",
: @V"job_id", "@V"job_name"", error

: where error is my error message.

: This does NOT write to the 24x7 log at all.

: Since I want the script to also stop processing, I added a OnErrorStop within
: my custom script... but this seems to be ignored.

: is there anyway I can have BOTH 24x7 log the error & stop AND have some
: custom error functionality ?

Mon Jan 10, 2005 12:52 pm View user's profile Send private message
Eric



Joined: 10 Jan 2005
Posts: 15

Post Re: Bug in Error handling? Reply with quote

My call to the error condition is :

onErrorResumeNext
// Check for file or raise error
FileExists sourceCombine, fileOK

ifThen(fileOK, labelFileFound)
throwError("Could not write to the log file",5)

labelFileFound:

// rest of the script here

the function is :

OnErrorStop
LogAddMessageEx "ERROR", @V"job_id", "@V"job_name"", error
RaiseError error

The function is : throwError(message,severity)

i would expect that the error is thrown, and it is 'ignored' and the script resumes.

When throwError is called, it says to stop on error, and then the error is called by LogAddMessageEX, and even by RaiseError

in its original form.. NO errors were logged during 'Run now'

since I have turned off 'run in background'.. run now throws a message out to the log, but it is not a STOP... the script continues to process unless i call exit OUTSIDE the sub script

Mon Jan 10, 2005 1:35 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Bug in Error handling? Reply with quote

First of all you would need to add OnErrorStop to the throwError code otherwise RaiseError is ignored because of the OnErrorResumeNext mode.
Second, please run this script in the debugger and set new breakpoint on the throwError line. When you reach that line click Debug/Step In menu and check what is happening there.

: My call to the error condition is : onErrorResumeNext
: // Check for file or raise error
: FileExists sourceCombine, fileOK

: ifThen(fileOK, labelFileFound)
: throwError("Could not write to the log file",5)

: labelFileFound: // rest of the script here

: the function is : OnErrorStop
: LogAddMessageEx "ERROR", @V"job_id",
: "@V"job_name"", error
: RaiseError error

: The function is : throwError(message,severity)

: i would expect that the error is thrown, and it is 'ignored' and the script
: resumes.

: When throwError is called, it says to stop on error, and then the error is
: called by LogAddMessageEX, and even by RaiseError

: in its original form.. NO errors were logged during 'Run now'

: since I have turned off 'run in background'.. run now throws a message out to
: the log, but it is not a STOP... the script continues to process unless i
: call exit OUTSIDE the sub script

Mon Jan 10, 2005 2:34 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.