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

Exception Not Caught on Production Server

Hi,

although I've created a try-catch construct embracing my code, my production
server does not catch an exception like the following:

try
{
string a[]=new string[2];

a[0]=a[2]; -- error
}
catch (SystemException err)
{...}

If run from my debugging server the catch statement is properly executed
during debugging. What did I do wrong?

TIA,
Axel Dahmen
Nov 19 '05 #1
2 1227
Try Catching (no pun intended) a System.Exception, rather than a
System.SystemException.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Axel Dahmen" <NO*****@NoOneKnows.invalid> wrote in message
news:OO**************@TK2MSFTNGP09.phx.gbl...
Hi,

although I've created a try-catch construct embracing my code, my
production
server does not catch an exception like the following:

try
{
string a[]=new string[2];

a[0]=a[2]; -- error
}
catch (SystemException err)
{...}

If run from my debugging server the catch statement is properly executed
during debugging. What did I do wrong?

TIA,
Axel Dahmen

Nov 19 '05 #2
Thanks, Kevin, for trying to help me.

Your solution might be simple, but before I try it, may I ask for curiosity
what the difference is? I.e. what makes my debugging environment catch the
error while my production environment doesn't? Is it perhaps the difference
between .NET 1.0 (dev) and .NET 1.1 (prod)?

I also guess I can't get more "vague" on my exceptions as sometimes I have
to distinguish between them, like:

try
{...}
catch (SqlException err)
{...}
catch (SystemException err)
{...}

Most of the time I actually *want* to react only to particular error
conditions as the error handling code is closely bound to the exception
type. If now I would have to add an additional catch-block to each and every
exception I've written, that would become a not too unimportant overhead
now.

Thanks for enlightening me!

Regards,
Axel Dahmen

------------
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> schrieb im Newsbeitrag
news:ey**************@TK2MSFTNGP10.phx.gbl...
Try Catching (no pun intended) a System.Exception, rather than a
System.SystemException.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"Axel Dahmen" <NO*****@NoOneKnows.invalid> wrote in message
news:OO**************@TK2MSFTNGP09.phx.gbl...
Hi,

although I've created a try-catch construct embracing my code, my
production
server does not catch an exception like the following:

try
{
string a[]=new string[2];

a[0]=a[2]; -- error
}
catch (SystemException err)
{...}

If run from my debugging server the catch statement is properly executed
during debugging. What did I do wrong?

TIA,
Axel Dahmen


Nov 19 '05 #3

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

Similar topics

1
by: Christopher D. Wiederspan | last post by:
I've got a WebServices application that uses Crystal Reports to produce and then export Invoices to PDF format. Without getting into too many details, it's just a big loop statement that goes out...
2
by: MatthewRoberts | last post by:
Howdy All, I have a Windows Service that often stops in its tracks with no exception and no explanation on our QA system. During testing on the development machine, it can handle any workload,...
7
by: Jon Maz | last post by:
Hi All, The following code throws a "CS0020: Division by constant zero Exception". I would have expected to see a nice, friendly "caught an exception" written to the screen. Can anyone...
6
by: Vadivel Kumar | last post by:
I've a problem in handling a custom exception The following is my custom exception class: public class AppException : public Exception { public AppException (string message, Exception...
2
by: James Cooke | last post by:
Hi all, I want to catch a duplicate key exception. I do not want to provide that verbose message from the MSSQL server - I would put a user friendly message out, like "The item you have added...
9
by: Claudio Di Flumeri | last post by:
Hello all, I've added a global exception handler to my application in this way: Sub Main() AddHandler Application.ThreadException, AddressOf ThreadException AddHandler...
4
by: Rob Richardson | last post by:
Greetings! I am working on an application that targets a Pocket PC running Windows CE and SQL Server CE. Almost all functions in the application use a Try block with a Catch block that looks...
7
by: Alec MacLean | last post by:
Hi all, I'm trying to deploy an ASP.NET (1.1) app to our production webserver, but having problems with the DAAB (from Ent Lib June 2005). As you might guess, it works just fine and dandy on my...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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...

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.