trace-fn now captures exceptions and logs exception type, exception message, and arguments that caused exception.