WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Error Codes

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

IntControl 73 Not Capturing Error

 Keywords: IntControl 73 Not Capturing Error Handling 3048 error substitution variable not followed by percent % 

Question:

It appears that some fatal errors are trappable with an IntControl 73 (e.g. division by zero) and some are not (see example below). How does one determine which fatal errors will and won't be trapped by this IntControl?

Also, any ideas for trapping an error such as the below? (Yes, I know it's a syntax error that simply needs to be corrected by the developer, but I still would like to trap for stuff like this if it slips through to production.) Intcontrol(73,1,@true,0,0) TestString = strclean("abcdefg","%","",@false,1);3048 error substitution variable not followed by percent exit :WBERRORHANDLER Error=LastError() ErrorMessage=strcat("Error: ",Error,"|") ErrorMessage=strcat(ErrorMessage,"wberrorhandlerline: ",wberrorhandlerline,"|") ErrorMessage=strcat(ErrorMessage,"wberrorhandleroffset: ",wberrorhandleroffset,"|") ErrorMessage=strcat(ErrorMessage,"wberrorhandlerassignment: ",wberrorhandlerassignment,"|") ErrorMessage=strcat(ErrorMessage,"wberrorhandlerfile: ", wberrorhandlerfile,"|") ErrorMessage=strcat(ErrorMessage,"wberrortextstring: ", wberrortextstring,"|") ErrorMessage=strcat(ErrorMessage,"wberroradditionalinfo: ", wberroradditionalinfo,"|") ErrorMessage=strcat(ErrorMessage,"wberrorinsegment: ", wberrorinsegment,"|") ErrorMessage=strcat(ErrorMessage,"wberrorhandlerlinenumber: ", wberrorhandlerlinenumber,"|")

Answer:

IntControl 73 can be used to capture all minor (1000 level), moderate (2000 level) and fatal (3000 level) errors.

However, you have found one exception to the rule...

The issue is that WinBatch is unable to capture that particular error because it happens before the line gets executed. That error gets thrown during the preparsing of the line. Before Winbatch executes any code it parses the line looking for variable subsitution and replaces the %variable% with contents of the variable then WinBatch begins processing to code, hence why it is not getting caught by IntControl 73.


Article ID:   W17869
Filename:   IntControl 73 Not Capturing Error .txt
File Created: 2009:09:30:13:08:04
Last Updated: 2009:09:30:13:08:04