Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Blowing past an exception
Message
From
19/12/2009 05:49:20
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01439539
Message ID:
01439907
Views:
30
>Hi,
>I have a line of code that throws an ArgumentNullException.
>When this line executes it behaves as if the exception was caught somewhere and silently 'swallowed' - i.e the app continues running
>
>But I don't have any exception handlers that would catch this and if I set the debugger to break when the exception is thrown (rather than just when unhandled) and then continue to step through the code no other code executes and the app continues to run (but stepping kicks in again say for a mousemove event....)
>
>Any clues as to what can cause this behaviour?
>TIA,
>Viv
>
>UPDATE: I get this in the Output window when I continue after the error (code is triggered by an OnDrop():
Step into: Stepping over non-user code 'System.Windows.RoutedEventArgs.InvokeHandler'
>Step into: Stepping over non-user code 'System.Windows.UIElement.RaiseEventImpl'
>Step into: Stepping over non-user code 'System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry'
>Step into: Stepping over non-user code 'System.Windows.ReverseInheritProperty.OnOriginValueChanged'
>Step into: Stepping over non-user code 'System.Windows.Input.MouseDevice.ChangeMouseOver'
>Step into: Stepping over non-user code 'System.Windows.Input.MouseDevice.PreProcessInput'
>Step into: Stepping over non-user code 'System.Windows.Input.InputManager.ProcessStagingArea'
>Step into: Stepping over non-user code 'System.Windows.Input.InputProviderSite.ReportInput'
>Step into: Stepping over non-user code 'System.Windows.Interop.HwndMouseInputProvider.ReportInput'
>Step into: Stepping over non-user code 'System.Windows.Interop.HwndMouseInputProvider.FilterMessage'
>Step into: Stepping over non-user code 'System.Windows.Interop.HwndSource.InputFilterMessage'
>Step into: Stepping over non-user code 'MS.Win32.HwndWrapper.WndProc'
>Step into: Stepping over non-user code 'MS.Win32.HwndSubclass.DispatcherCallbackOperation'
>Step into: Stepping over non-user code 'System.Windows.Threading.ExceptionWrapper.InternalRealCall'
>Step into: Stepping over non-user code 'System.Windows.Threading.ExceptionWrapper.TryCatchWhen'
>Step into: Stepping over non-user code 'System.Windows.Threading.Dispatcher.InvokeImpl'
>Step into: Stepping over non-user code 'MS.Win32.HwndSubclass.SubclassWndProc'
>Step into: Stepping over non-user code 'System.Windows.Threading.Dispatcher.PushFrameImpl'
Only thing I can think of is that something is swallowing it in there......

I think I've worked out what is happening here. If the object being dropped is from within the application then the exception is raised as expected. If, however, the drop object is external to the appliction (e.g. a file from Windows Explorer) then the exception is handled by the drag initiator.

AFAICS this is a bit nasty - the implication being that unless all the code in any OnDrop() method is wrapped in a try/catch block and any exception is safely handled there you can have serious problems!

Thoughts ?
Previous
Reply
Map
View

Click here to load this message in the networking platform