replacing with a generic exception handler