12 } catch (Exception ex) {
17 static int FrameCount (Exception ex)
19 string fullTrace = ex.StackTrace;
20 string[] frames = fullTrace.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
23 frames = frames.Where (l => !l.StartsWith ("[")).ToArray ();
28 public static void Main ()
34 } catch (Exception ex) {
35 int frames = FrameCount (ex);
37 throw new Exception (String.Format("Exception carried {0} frames along with it when it should have reported one.", frames));
46 } catch (Exception ex) {
47 int frames = FrameCount (ex);
49 throw new Exception (String.Format("Exception carried {0} frames along with it when it should have reported four.", frames));