throws the appropriate error when a duplicate operation is found