--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcountry.exceptions;
+
+import java.text.MessageFormat;
+import org.mxchange.jcountry.data.Country;
+
+/**
+ * An exception thrown when a country is already registered. This can be easily
+ * checked if the country code is already there.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public class CountryAlreadyAddedException extends Exception {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 186_971_766_917_042L;
+
+ /**
+ * Constructor with newly country (no id number)
+ * <p>
+ * @param country Country instance
+ */
+ public CountryAlreadyAddedException (final Country country) {
+ // Call super constructor
+ super(MessageFormat.format("Country with code {0} or i18n key {1} has already been added.", country.getCountryCode(), country.getCountryI18nkey()));
+ }
+
+}