In C#, I can use the throw; statement to rethrow an exception while preserving the stack trace:
throw;
try { ... } catch (Exception e) { if (e is
Stack trace is prserved if you wrap the catched excetion into an other exception (to provide more info) or if you just rethrow the catched excetion.
try{ ... }catch (FooException e){ throw new BarException("Some usefull info", e); }