At times, an anvil can deny your enchantment by calling it “too expensive”. It simply means that you have reached the cap of enchanting. Anything costing more than 40 levels of experience is considered too expensive to enchant.