Extract error handling