Function isErrorResponse