Can't access exception properties shown in Locals
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2015
09:31 AM
10-21-2015
09:31 AM
Can't access exception properties shown in Locals
I've came across this strange situation: I catch an exception to write its details to a log entry, but in the log entry I can see undefined instead of the attribute values expected and shown in the Locals window.
The portion of the code:
try { fso.CreateTextFile(fullname); return path; } catch (x) { // Something went wrong // Because exception forwarding between modules is not reliable in TC, // and this method is usually called from other modules, let's create // a log entry and an error code instead. Log.Error("File creation error", "Could not create [" + fullname + "] because of an error named [" + x.Name + "]\r\n\r\nDetails: " + x.Message, pmNormal); return ""; }
If you take a look at Locals.png, you'll see the exception object's attributes contain legitime values. However the log shows what you can see in Log.png. What am I missing?
Solved! Go to Solution.
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2015
09:45 AM
10-21-2015
09:45 AM
JScript is case-sensitive:
x.Name --> x.name
x.Message --> x.message
Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2015
11:16 AM
10-21-2015
11:16 AM
Oh God! Thanks for correcting me. It was so great to enjoy full intellisense in TC. 🙂
