[Mono-bugs] [Bug 419634] catch(Exception){throw; } within a catch block is throwing the previous exception

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Aug 22 16:02:16 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=419634

User rajneeshpatel at gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=419634#c2





--- Comment #2 from Raj Patel <rajneeshpatel at gmail.com>  2008-08-22 14:02:15 MDT ---
Workaround is to catch(Exception e){ throw e;}

(In reply to comment #0 from Raj Patel)
> Within a catch block e.g catch(ApplicationException ae) if you have a nested
> try/catch block with a catch(Exception){throw;} the ApplicationException is
> thrown instead of the Exception caught by catch(Exception)
> 
>             try
>             {
>                 throw new ApplicationException();
>             }
>             catch (ApplicationException ae)
>             {
>                 try
>                 {
>                     throw new IOException();
>                 }
>                 catch (Exception)
>                 {
>                     throw;
>                 }
>             } 
> 
> So in the above case, in windows .NET, the IOException is thrown but in mono on
> unix, the ApplicationException is thrown
> 


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list