473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Is adding information to Exception.Data frowned upon?

I have a function that accepts an Exception, and writes out all of its
information to a log. This function is called in many places where an
exception is caught. In some places, I'd like to add one more bit of
information to the log. I could just write it out to the log there,
or, I could add it to the Exception.Data dictionary.

I am wondering if it is 'bad' to edit Data in a system exception?

I realize that Exception.Data is mainly used by programmers in their
own exception types, so this is likely not common. Also, note that I
am not rethrowing the exception, so I am not creating a new exception
(with the old one tucked away as an InnerException) with which I would
create my own Data dictionary.

Zytan

Mar 30 '07 #1
1 2145
Zytan,
That is precisely what the Data collection is for - to add additional
information to an Exception object. Have fun.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Zytan" wrote:
I have a function that accepts an Exception, and writes out all of its
information to a log. This function is called in many places where an
exception is caught. In some places, I'd like to add one more bit of
information to the log. I could just write it out to the log there,
or, I could add it to the Exception.Data dictionary.

I am wondering if it is 'bad' to edit Data in a system exception?

I realize that Exception.Data is mainly used by programmers in their
own exception types, so this is likely not common. Also, note that I
am not rethrowing the exception, so I am not creating a new exception
(with the old one tucked away as an InnerException) with which I would
create my own Data dictionary.

Zytan

Mar 31 '07 #2

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

Similar topics

4
by: dada | last post by:
I have many php files and I would like to simulate low speed connectivity by adding sleep(5); statement to all the php pages. Instead of adding this statement manually to all the php files is...
6
by: Clarence Gardner | last post by:
I've got a problem that I don't see how to program around. A socket server that was running fine, today started getting an exception from the bind() call (errno 22, Invalid argument) and yet the...
47
by: Pierre Barbier de Reuille | last post by:
Please, note that I am entirely open for every points on this proposal (which I do not dare yet to call PEP). Abstract ======== This proposal suggests to add symbols into Python. Symbols...
2
by: Odd-R. | last post by:
I have come over a strange problem regarding exceptions This is my code: try: #some operation except Exception, info: #some message except: #??
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
1
by: mitchman10 | last post by:
My Time table has TimeID,Employee,PayPeriod,ChargeCodeID,Hours My Chargecode table has ChargecodeID,c_Text I need an Editable datagrid that will show the TimeID,Employee,PayPeriod,C_Text in a...
12
by: JMO | last post by:
I can import a csv file with no problem. I can also add columns to the datagrid upon import. I want to be able to start importing at the 3rd row. This will pick up the headers necessary for the...
0
by: =?Utf-8?B?QW5keSBZdQ==?= | last post by:
Hi, I'm trying to return exceptions from a WCF Service using FaultExceptions. I got the service compiled and running. But I get an error while adding a service reference to it. The error reads: "...
5
by: wxPythoner | last post by:
Why is the \ backslash character frowned upon? Can I still use it in Python 3.0 to achieve the same thing it was designed to do?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.