Better error handling for exceptions inside compat classes