[Mono-bugs] [Bug 75644][Nor] New - On Error statements do not work

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Jul 27 03:26:20 EDT 2005

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by tv3-117vma at freemail.hu.


--- shadow/75644	2005-07-27 03:26:20.000000000 -0400
+++ shadow/75644.tmp.19883	2005-07-27 03:26:20.000000000 -0400
@@ -0,0 +1,70 @@
+Bug#: 75644
+Product: Mono: Class Libraries
+Version: 1.0
+OS: SUSE 9.2
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: VB Runtime
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: tv3-117vma at freemail.hu               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: On Error statements do not work
+Please fill in this template when reporting a bug, unless you know what you 
+are doing.
+Description of Problem:
+When using On Error statements in a Visual Basic code for error handling 
+and an Exception is thrown the application crashes.
+Steps to reproduce the problem:
+1. Here is an example:
+Module Module1
+    Sub Main()
+        OnErrorSub()
+    End Sub
+    Sub OnErrorSub()
+        On Error GoTo ErrorHandling
+        Console.WriteLine("OnErrorSub before throwing Exception")
+        Throw New InvalidOperationException("OnErrorSub test Exception")
+        Console.WriteLine("OnErrorSub after throwing Exception")
+        Exit Sub
+        Console.WriteLine("OnErrorSub error handling")
+        Console.WriteLine(Err.Description)
+        Err.Clear()
+    End Sub
+End Module
+run it using mono
+watch the results in the terminal:
+Actual Results:
+OnErrorSub before throwing Exception
+Unhandled Exception: System.NullReferenceException: Object reference not 
+set to an instance of an object
+in <0x000ac> MonoErrorTest.Module1:OnErrorSub ()
+in <0x0004a> MonoErrorTest.Module1:Main ()
+Expected Results:
+OnErrorSub before throwing Exception
+OnErrorSub error handling
+OnErrorSub test Exception
+How often does this happen? 
+Additional Information:

More information about the mono-bugs mailing list