473,804 Members | 3,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

properties; discovery; exposing objects

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.
Feb 22 '08 #1
1 1451
On Feb 23, 7:41*am, mk83...@yahoo.c om wrote:
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.

--
Rob
Feb 22 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
12042
by: Generic Usenet Account | last post by:
A lot has been said in this newsgroup regarding the "evil" set/get accessor methods. Arthur Riel, (of Vanguard Training), in his class, "Heuristis for O-O Analysis & Design", says that there is almost never an excuse for accessor methods. Personally, I do not go that far. I do feel that they serve a useful purpose (albeit in a limited manner). Personally I prefer dropping the "set" and "get" prefixes from the method names altogether. ...
9
12430
by: kj | last post by:
Is there any way to programmatically discover and inspect *all* the properties of an object, even those that are not enumerable through a for/in loop? Thanks! kj -- NOTE: In my address everything before the period is backwards.
1
4628
by: Jamus Sprinson | last post by:
Before I continue, I'm going to begin by saying I'm not by any means an expert- I've been using .NET with C# for about 4 months now, and basically just learning by example and docs. A game project I work on uses Xml serialization to store game objects for loading. One of the techniques we use is to make an array property and use the set block to perform actions on the values after they're loaded from the xml, as in: public string Ids
8
1173
by: Rakesh | last post by:
Hi, Suppose I have a class definition like this: public class CBase { public string m_Name = "asd"; public string Name { get
3
5752
by: Dave Veeneman | last post by:
Is there a way to expose an internal class as a public property of its parent object? Let's say I have a Customer object with Public accessibility. It has an Addresses collection property that it populated with Address objects. This property has Public accessibility, as well. To keep the assembly interface clean, I want to hide the objects on which the property is based (The Address and Addresses objects) from users outside the assembly....
26
1765
by: julien | last post by:
Hello, I don't know when to use fields and when to used properties. It looks to me that using properties is always better. But I guess fields must be better in some cases, otherwise they wouldn't exist! Thank you Julien
5
4471
by: Sergio Montero | last post by:
I have a MustInherits Base class that implements a custom IDataLayer interfase. IDataLayer expose CRUD methods. Base class constructor requires two parameters: ConnectionString TableName Another assembly, sharing the root namespace, contains a set of Custom attributes used to validate properties values, just like the Validation Application Block.
6
1100
by: Dom | last post by:
I have a class that has a System.Drawing.Rectangle as a member, called m_Rect. I set it up as a property, like this: get { return m_Rect;} set { m_Rect = value;} Now in my main code I want to do the following: myObject.Rect.Width = width; myObject.Rect.Height = height;
6
1323
by: egaskill | last post by:
So I'm trying to figure out something...we need our company's internal PHP based intranet site redone as it runs horribly. We recently hired a company to come in and take a look at the code and give us some sort of specification for what we have and what needs to be done to rewrite the code in .NET they charged us around $5000 for Discovery time and gave us two sheets of paper with graphs on either. One of the graphs shows the...
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10594
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10331
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.