properties; discovery; exposing objects

M

mk834tt

Low hours pilot here.

I had a try/catch construct and had no idea what properties were
available via the catch error object. I'm trying to figure out how to
browse exposed properties. Is this a reliable way?

I "seem" to be able to collect all the keys

for (var x in er) {
alert("key: " + x );
}

But accessing their values was hit and miss, for various reasons.

I have firebug installed and see a lot of information exposed. I have
a hard time with it. Is this error object, or other objects, exposed
in any of the firebug panels? Most of the functions I open up report
"prototype Object".

Thank you.
 
R

RobG

Low hours pilot here.

I had a try/catch construct and had no idea what properties were
available via the catch error object.  I'm trying to figure out how to
browse exposed properties.  Is this a reliable way?

I "seem" to be able to collect all the keys

for (var x in er) {
  alert("key: " + x );

}

But accessing their values was hit and miss, for various reasons.

I have firebug installed and see a lot of information exposed.  I have
a hard time with it.  Is this error object, or other objects, exposed
in any of the firebug panels?  Most of the functions I open up report
"prototype Object".

Try:

function foo(){
try {
foobar()
} catch (e) {

// Write the properties and values of e to the console
console.dir(e);
}
}

The properties are listed in the console on the left in bold with
their values aligned on the right.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top