If logging debug, include stack trace even for InvalidOperationException

This is motivated by the change to have past_version now be wrapped. There is nothing more a user or customer devops can do, but for us we may need to be able to tell what part of our code signaled the error.