log when err encountered