log stack traces on error and keep error history
Merge pull request #352 from dcapwell/client-stacktrace

log stack traces on error and keep error history