473,395 Members | 1,521 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,395 software developers and data experts.

Try Catch statements

Hello,

I use Try Catch statements a lot in my applications so that the app
automatically e-mails me with any errors that the users are encountering. I
was just wondering if there are any performance issues with using Try Catch
statements a lot in an app?

Thanks,
Dusty Hackney

Feb 3 '06 #1
3 890
Dusty Hackney wrote:
Hello,

I use Try Catch statements a lot in my applications so that the app
automatically e-mails me with any errors that the users are encountering. I
was just wondering if there are any performance issues with using Try Catch
statements a lot in an app?

Thanks,
Dusty Hackney


It's not resource intensive. Unless you have hundreds of them per page I
wouldn't worry about it... There's nothing wrong with handling (and
logging) errors - much the inverse.
Feb 3 '06 #2
In addition, having the syntax for catching errors does not affect
performance. If the application is working as expected, there should be no
decrease in performance.

Handling exceptions that are thrown are expensive but if something bad is
happening, you would want to know. By the way, considering the overhead in
emailing the errors, I would say that the performance hit by catching
exceptions is overshadowed by the email operations. :-)

"john smith" <jo**@smith.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Dusty Hackney wrote:
Hello,

I use Try Catch statements a lot in my applications so that the app
automatically e-mails me with any errors that the users are encountering.
I was just wondering if there are any performance issues with using Try
Catch statements a lot in an app?

Thanks,
Dusty Hackney


It's not resource intensive. Unless you have hundreds of them per page I
wouldn't worry about it... There's nothing wrong with handling (and
logging) errors - much the inverse.

Feb 3 '06 #3
We save exception logs to an SQL database and poll the database each hour
and if new records exist, then we mail the administrator/developers.

--
Terry Burns
http://TrainingOn.net
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:OU**************@TK2MSFTNGP15.phx.gbl...
In addition, having the syntax for catching errors does not affect
performance. If the application is working as expected, there should be
no decrease in performance.

Handling exceptions that are thrown are expensive but if something bad is
happening, you would want to know. By the way, considering the overhead
in emailing the errors, I would say that the performance hit by catching
exceptions is overshadowed by the email operations. :-)

"john smith" <jo**@smith.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Dusty Hackney wrote:
Hello,

I use Try Catch statements a lot in my applications so that the app
automatically e-mails me with any errors that the users are
encountering. I was just wondering if there are any performance issues
with using Try Catch statements a lot in an app?

Thanks,
Dusty Hackney


It's not resource intensive. Unless you have hundreds of them per page I
wouldn't worry about it... There's nothing wrong with handling (and
logging) errors - much the inverse.


Feb 3 '06 #4

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

Similar topics

23
by: VB Programmer | last post by:
Variable scope doesn't make sense to me when it comes to Try Catch Finally. Example: In order to close/dispose a db connection you have to dim the connection outside of the Try Catch Finally...
7
by: Tiraman | last post by:
Hi , I am using allot the try catch in my code and the question is if it is good ? it will decrease my performance ? one more question
9
by: Michael MacDonald | last post by:
Does someone have a good site I can visit or explain the use of Try" and Catch foe exception/error handling. What is the logic behind this command and maybe an example would be great!!!! Mike_Mac...
5
by: Patrick Dickey | last post by:
Hello, All! I'm modifying some source code that I downloaded from Planet-source-code a while back, and have a question about Try Catch statements. Basically, I'm wondering if I can do a Try with...
32
by: cj | last post by:
Another wish of mine. I wish there was a way in the Try Catch structure to say if there wasn't an error to do something. Like an else statement. Try Catch Else Finally. Also because I...
3
by: Michael C | last post by:
I'm writing an app on the PDA using C# with .net 1.1. It is all working well except in some cases a try catch is simply ignored and a totally different error is returned. I've got code like below...
12
by: reycri | last post by:
While the following is allowed: if (a == b) SomeFunction(); else OtherFunction(); The following is not: try
12
by: dawn13 | last post by:
I know this will sound like a really stupid question, but here goes. I am in the middle of debugging someone else's code and am getting more confused by the second. Does the try catch require an...
3
Logan1337
by: Logan1337 | last post by:
Hi all. I have a method involving several statements, none of which are dependent on any other. Basically I am simply setting a bunch of properties, one after the other, and want to essentially...
3
by: =?Utf-8?B?SmVycnk=?= | last post by:
Hi All, I want to fill some textbox with properties from Active Directory. The fact is if the property is unavailable the program will crash. You can prevent this by using a try and catch. So...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...

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.