error_catch function

General Error Catching