This looks like it will log the html part of the accumulated message 'msg', where I think we really only want the err.message.