Make newFunc return error.