![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Is there a way to capture the line that caused and error I have a function in my script which is an error logger. Many lines of code call it and I log any errors thrown up by my script. I would like to also record the line in the code that caused the specific error. This would be similar to the message you get when cscript throws the error to the screen in brackets. The only properties I know of for err are. Err.Number Err.Description Err.Source I tried Err.Line bit it didn't seem to work. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Is there a way to capture the line that caused and error "Bob Smith" <BobSmith@xxxxxx> wrote in message news:0CBF5B42-7310-44AF-8185-7F528FE7F57D@xxxxxx Quote: >I have a function in my script which is an error logger. Many lines of code > call it and I log any errors thrown up by my script. I would like to also > record the line in the code that caused the specific error. This would be > similar to the message you get when cscript throws the error to the screen > in > brackets. The only properties I know of for err are. > > Err.Number > Err.Description > Err.Source > > I tried Err.Line bit it didn't seem to work. > I can think of is to maintain your own line number or step number variable, and pass this to your error function. A lot of work, but I've done this in VB. However in VBScript I see no way to call your function, except to repeatedly test Err.Number. If this is how you call your error function, you can pass a different number in each call. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Display error caused by usb key | General Discussion | |||
| problem with the bluescreen error. caused by the wirless networkin | Vista hardware & devices | |||
| WaitForExit() times out when I try to capture multi-line Stdout | .NET General | |||
| error window caused by use of Start/Search | Vista General | |||