understand how jenkins keeps an error when pipeline fails

Hi I am using the emailext plugin and in my pipeline I used try and catches to catch error so I could send mail to the developers and notify them but in the configuration of emailext I don’t understand how to use enviroment variables ${ENV,var=global_exception} dosent work
so I want to ask 2 things how to use it correctly (ENV)
and if there is already env variable that catch the error that fail the pipeline from jenkins side