4 ms·
Exception it is. And how does it pass down the stack? There won't be any trace of it without it being caught.
by nreece 15y ago
Exception it is. And how does it pass down the stack? There won't be any trace of it without it being caught.
- bullsbarry 15y agoIf an exception isn't caught, the caller will receive an opportunity to catch it, and so on until it hits the top of the call stack and the default handling occurs (a nasty, unhelpful error message is displayed)
- bunderbunder 15y agoThe stack trace is generated at the moment the exception is created. Unnecessarily catching exceptions you don't intend to deal with is a habit that is much more dangerous to stack traces, because it's easy to miss the huge semantic distinction between // leaves the Exception's stack trace intact. catch (Exception ex) { throw; } and // Replaces the Exception's stack trace // with a trace to the current execution point. catch (Exception ex) { throw ex; }