[#1757]fix exception to log correctly with stack trace