add some missing closing braces to error_handling.R