11 } catch (Exception ex
) {
16 static int FrameCount (Exception ex
)
18 string fullTrace
= ex
.StackTrace
;
19 string[] frames
= fullTrace
.Split(new string[] { Environment.NewLine }
, StringSplitOptions
.None
);
23 public static void Main ()
29 } catch (Exception ex
) {
30 int frames
= FrameCount (ex
);
32 throw new Exception (String
.Format("Exception carried {0} frames along with it when it should have reported one.", frames
));
41 } catch (Exception ex
) {
42 int frames
= FrameCount (ex
);
44 throw new Exception (String
.Format("Exception carried {0} frames along with it when it should have reported four.", frames
));