Advertisement
Guest User

Recurse Exception

a guest
Feb 25th, 2020
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3.     try
  4.     {
  5.         Recurse();
  6.         Console.WriteLine("No exception thrown.");
  7.     }
  8.     catch (OutOfMemoryException e)
  9.     {
  10.         Console.WriteLine("Out of memory exception thrown.");
  11.     }
  12.     catch (StackOverflowException e)
  13.     {
  14.         Console.WriteLine("Stack overflow exception thrown.");
  15.     }
  16.     catch (InsufficientExecutionStackException e)
  17.     {
  18.         Console.Write("Insufficient execution stack exception thrown.");
  19.     }
  20.     catch (Exception e)
  21.     {
  22.         Console.WriteLine("Some kind of exception thrown.");
  23.     }
  24. }
  25.  
  26. private static void Recurse()
  27. {
  28.     Recurse();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement