public Element handle(FreeColServer server, Player player,
                          Connection connection) {
        ServerPlayer serverPlayer = server.getPlayer(connection);

        Unit carrier;
        try {
            carrier = player.getFreeColGameObject(carrierId, Unit.class);
        } catch (Exception e) {
            return DOMMessage.clientError(e.getMessage());
        }
        if (!carrier.canCarryGoods()) {
            return DOMMessage.clientError("Not a goods carrier: " + carrierId);
        } else if (!carrier.isInEurope()) {
            return DOMMessage.clientError("Not in Europe: " + carrierId);
        }

        GoodsType type = server.getSpecification().getGoodsType(goodsTypeId);
        if (type == null) {
            return DOMMessage.clientError("Not a goods type: " + goodsTypeId);
        } else if (!player.canTrade(type)) {
            return DOMMessage.clientError("Goods are boycotted: "
                + goodsTypeId);
        }

        int amount;
        try {
            amount = Integer.parseInt(amountString);
        } catch (NumberFormatException e) {
            return DOMMessage.clientError("Bad amount: " + amountString);
        }
        if (amount <= 0) {
            return DOMMessage.clientError("Amount must be positive: "
                                       + amountString);
        }
        int present = carrier.getGoodsCount(type);
        if (present < amount) {
            return DOMMessage.clientError("Attempt to sell "
                + Integer.toString(amount) + " " + type.getId()
                + " but only " + Integer.toString(present) + " present.");
        }

        // Try to sell.
        return server.getInGameController()
            .sellGoods(serverPlayer, carrier, type, amount);
    }