473,761 Members | 10,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

wierd behavior - no Exceptions thrown!


Hi...

This is driving me crazy and I really hope I can get an answer...

Take a look at the piece of code below (I'm using .net 2.0):
try
{
double pointTime = XDate.DateTimeT oXLDate(point.t ime);
double pointValue = Convert.ToDoubl e(point.value);
list.Add(pointT ime, pointValue);
}
catch (Exception ex)
{
throw new Exception("Erro r in function SetFunction", ex);
}

When the application reaches:
double pointValue = Convert.ToDoubl e(point.value);
it should sometimes throw an exception because I sometimes put in a string
with some text (I will add checking later).
The problem is that this code doesn't throw an exception but it just hangs!
When I added the try/catch block the exception was handled and the catch
block
was reached so I decided to throw another exception just to test things and
now the execution HANGS HERE!!
I should mention the UI is still responsive... I can still run the
application and I can even run the above method with correct
parameters and it works normaly...
It is if the exception is thrown to some secret thread and is "handled"
there...
I added:
Application.Thr eadException += new
System.Threadin g.ThreadExcepti onEventHandler( Application_Thr eadException);
AppDomain.Curre ntDomain.Unhand ledException += new
UnhandledExcept ionEventHandler (CurrentDomain_ UnhandledExcept ion);

but the code never reaches these two handlers...

And the same thing happens all over the application (except some parts at
the beginning).

The entire application currently runs on one thread, except for the use of
some System.Windows. Forms.Timer timers (which I don't even start anymore
because I was thinking they are causing the error).
If I try and throw an exception in the beginning of the app it works but
somewhere something has to be set, which triggers such behavior :S and I
don't know what
The problem is that I never before saw such behavior... I don't even know
what to try...

Thanks for any kind of advice...
sašo

Mar 27 '06 #1
1 1449
anyone?

"Sašo Zagoranski" <sa************ *@guest.arnes.s i> wrote in message
news:e0******** **@planja.arnes .si...

Hi...

This is driving me crazy and I really hope I can get an answer...

Take a look at the piece of code below (I'm using .net 2.0):
try
{
double pointTime = XDate.DateTimeT oXLDate(point.t ime);
double pointValue = Convert.ToDoubl e(point.value);
list.Add(pointT ime, pointValue);
}
catch (Exception ex)
{
throw new Exception("Erro r in function SetFunction", ex);
}

When the application reaches:
double pointValue = Convert.ToDoubl e(point.value);
it should sometimes throw an exception because I sometimes put in a string
with some text (I will add checking later).
The problem is that this code doesn't throw an exception but it just
hangs!
When I added the try/catch block the exception was handled and the catch
block
was reached so I decided to throw another exception just to test things
and now the execution HANGS HERE!!
I should mention the UI is still responsive... I can still run the
application and I can even run the above method with correct
parameters and it works normaly...
It is if the exception is thrown to some secret thread and is "handled"
there...
I added:
Application.Thr eadException += new
System.Threadin g.ThreadExcepti onEventHandler( Application_Thr eadException);
AppDomain.Curre ntDomain.Unhand ledException += new
UnhandledExcept ionEventHandler (CurrentDomain_ UnhandledExcept ion);

but the code never reaches these two handlers...

And the same thing happens all over the application (except some parts at
the beginning).

The entire application currently runs on one thread, except for the use of
some System.Windows. Forms.Timer timers (which I don't even start anymore
because I was thinking they are causing the error).
If I try and throw an exception in the beginning of the app it works but
somewhere something has to be set, which triggers such behavior :S and I
don't know what
The problem is that I never before saw such behavior... I don't even know
what to try...

Thanks for any kind of advice...
sašo

Mar 27 '06 #2

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

Similar topics

26
2913
by: OvErboRed | last post by:
I just read a whole bunch of threads on microsoft.public.dotnet.* regarding checked exceptions (the longest-running of which seems to be <cJQQ9.4419 $j94.834878@news02.tsnz.net>. My personal belief is that checked exceptions should be required in .NET. I find that many others share the same views as I do. It is extremely frustrating to have to work around this with hacks like Abstract ADO.NET and CLRxLint (which still don't solve the...
4
1829
by: Johannes Hansen | last post by:
What are the best practice on handling an exception caused by a Dispose method when its called from inside a loop? Wrap the entire loop in a try-catch or do the try-catch on each iteration to get as many of the object Disposed as possible? Take the following example: Bitmap bmpArray = ... // Some fancy bitmap array. try {
0
968
by: globus | last post by:
Hi, I've a c# project calling a COM Interop library method. This method starts a Service , so I need administrator or power user rights to use it without exceptions. I'm developing exceptions management for my project and I call this method using another user to see which exception is thrown. And here comes the strange behavior... If I debug all project without any breakpoints , I have a generic System.ComException....etc... If I debug...
2
3507
by: felecha | last post by:
I learned about Exceptions in School, and now that I'm building my first real application on the job, I'm going through it trying to analyze it for all possible Exceptions so I can handle them effectively. I've been looking in the Help / Index for each Method's documentation, and looking at the listed Exceptions. I'm finding a number of methods with no Exceptions specified. Does that mean there is no possible Exception for that method?...
14
3481
by: dcassar | last post by:
I have had a lively discussion with some coworkers and decided to get some general feedback on an issue that I could find very little guidance on. Why is it considered bad practice to define a public member with a return type that is derived from System.Exception? I understand the importance of having clean, concise code that follows widely-accepted patterns and practices, but in this case, I find it hard to blindly follow a standard...
3
1551
by: Tom | last post by:
We are experiencing some wierd debugging behavior. What happens is that, during debugging with VS 2003, the debugger seems to 'skip' statements that are associated with database operations. For instance, I can be single-stepping through a VB.NET program, and once I hit a DB related statement (such as setting command parameters, executing a data reader, etc) the debugger will simply 'skip' ahead a number of statements (if not all the way to...
5
2276
by: noone | last post by:
hi. I don't use exceptions much in the embedded world, but for my plugin interface to a hardware MPEG encoder I'd like to, since there are so many places that the crummy kernel driver can do bad things to my userland program. I hope this news client doesn't reformat my example below and make it impossible to read. :^) consider the following exception heirarchy
2
2968
by: Zytan | last post by:
I know that WebRequest.GetResponse can throw WebException from internet tutorials. However in the MSDN docs: http://msdn2.microsoft.com/en-us/library/system.net.webrequest.getresponse.aspx It only lists NotImplementedException in the Exceptions section. (Note that it does mention WebException in the Remarks section, but who knows if this is always the case for such classes, and thus perhaps they can't be trusted to always list these, and...
10
2826
by: =?Utf-8?B?ZHNoZW1lc2g=?= | last post by:
Hello, I have a C# project with windows forms. I sometimes get unprdictable .NET exceptions. I don't always get them, so I can't reproduce where exactly it happens. I can generally say it happens when closing the application (maybe in the dispose method?). Here are 2 examples: System.Threading.ThreadAbortException: Thread was being aborted. at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32...
0
9531
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
9345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10115
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...
1
9905
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,...
1
7332
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3881
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2752
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.