improve exception handling to log the stack trace if available (via
Throwable implementations)