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
something like this
try { ... } catch (FooException e) { throw e; } catch (Exception e) { ... }