Is there any way to send an email when ever error happened in entire application globally?

Thank You so much. Will check and get back to You.