Capture stack traces for error types