Hello,
Is there a way to determine the line that threw an error?
Thanks,
-jack
Output Line in Error Log
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Output Line in Error Log
Yes, use the LAST_ERROR_LINE variable.
When an error occurs you will see these variables in the watch list:
LAST_ERROR=description of error
LAST_ERROR_LINE=line number that caused the error.
These are very useful when combined with a custom error handler which could e.g. write to a log file and/or alert you via email etc.
https://www.mjtnet.com/manual/index.htm ... ndling.htm
When an error occurs you will see these variables in the watch list:
LAST_ERROR=description of error
LAST_ERROR_LINE=line number that caused the error.
These are very useful when combined with a custom error handler which could e.g. write to a log file and/or alert you via email etc.
https://www.mjtnet.com/manual/index.htm ... ndling.htm
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Newbie
- Posts: 5
- Joined: Mon Jan 26, 2015 5:38 am
Re: Output Line in Error Log
Got it, thanks... must have missed the _LINE in the docs (I had been using LAST_ERROR but wanted to trace where it was throwing from).
As a side note, is there a way to raise an error?
As a side note, is there a way to raise an error?
-
- Newbie
- Posts: 5
- Joined: Mon Jan 26, 2015 5:38 am
Re: Output Line in Error Log
>> is there a way to raise an error? <<
For example, I use UIAccessibleList to check the contents of a window before performing an action, and I can't find a substring in that list, I'd like to throw an error.
I can manage it easily enough using a custom SRT but an error would keep things semantic.
For example, I use UIAccessibleList to check the contents of a window before performing an action, and I can't find a substring in that list, I'd like to throw an error.
I can manage it easily enough using a custom SRT but an error would keep things semantic.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Output Line in Error Log
Well if you already have a custom error routine just call it and set LAST_ERROR to whatever you want first.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?