How to capture response error and add to html report

I followed below post and it helped to capture error messages. I’m able to capture the response errors i html report.