fork(1) download
  1. using System;
  2.  
  3. class Test
  4. {
  5. static void Main(string[] args)
  6. {
  7. try
  8. {
  9. Top();
  10. }
  11. catch (Exception e)
  12. {
  13. Console.WriteLine(e);
  14. }
  15. }
  16.  
  17. static void Top()
  18. {
  19. try
  20. {
  21. Middle();
  22. }
  23. catch (Exception e)
  24. {
  25. throw new Exception("Exception from top", e);
  26. }
  27. }
  28.  
  29. static void Middle()
  30. {
  31. try
  32. {
  33. Bottom();
  34. }
  35. catch (Exception e)
  36. {
  37. throw new Exception("Exception from middle", e);
  38. }
  39. }
  40.  
  41. static void Bottom()
  42. {
  43. throw new Exception("Exception from bottom");
  44. }
  45. }
Success #stdin #stdout 0.02s 38056KB
stdin
Standard input is empty
stdout
System.Exception: Exception from top ---> System.Exception: Exception from middle ---> System.Exception: Exception from bottom
  at Test.Middle () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Test.Middle () [0x00000] in <filename unknown>:0 
  at Test.Top () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Test.Top () [0x00000] in <filename unknown>:0 
  at Test.Main (System.String[] args) [0x00000] in <filename unknown>:0