Bug 27728 - Exception in Exception filters (C# 6)
Summary: Exception in Exception filters (C# 6)
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-03-06 07:25 UTC by Marek Safar
Modified: 2015-03-09 16:12 UTC (History)
3 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Marek Safar 2015-03-06 07:25:04 UTC
Compile and Run

using System;
using static System.Console;

	class Program
	{
		static void Main(string[] args)
		{
			try
			{
				throw new Exception("TEST Exception");
			}
			catch (Exception ex) when (MethodThatThrowsAnException())
			{
				WriteLine("Filtered handler 1");
			}
			catch (IndexOutOfRangeException ex)
			{
				WriteLine("Index out of Range from Method Filter");
			}

			catch (Exception ex)
			{
				WriteLine("Forced Exception is caught " + ex);
			}
		}

		static bool MethodThatThrowsAnException()
		{
			throw new IndexOutOfRangeException("Index Out of Range");
		}
	}
Mono:

Unhandled Exception:
System.IndexOutOfRangeException: Index Out of Range
  at Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

.NET

Forced Exception is caught System.Exception: TEST Exception
   at Program.Main(String[] args)

Note You need to log in before you can comment on or make changes to this bug.