Error Handling of Failed Task

Hello Dear All,

I am using a playbook that gives below output intentionally. Is there any possible way that I can write this FAILED statement to a file in order to be used by another script?

thanks,

PLAY [CHECK USERS CORRECT] **************************************************************************************************************************************************************************************************************

TASK [collecting facts from CVP 172.16.91.3] ********************************************************************************************************************************************************************************************
fatal: [172.16.91.3]: FAILED! => {“changed”: false, “msg”: “\n172.16.91.3: Authenticate: http://172.16.91.3:443/web/login/authenticate.do: Request Error: Bad Request\n”}

PLAY RECAP ******************************************************************************************************************************************************************************************************************************
172.16.91.3 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0