--- /dev/null
+package de.juplo.facebook.exceptions;
+
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+
+
+/**
+ *
+ * @author kai
+ */
+public class PageMigratedException extends OAuthException
+{
+ private final static Pattern pattern =
+ Pattern.compile("Page ID ([0-9]+) was migrated to page ID ([0-9]+)");
+
+ private final Long oldId, newId;
+
+
+ public PageMigratedException(String message)
+ {
+ super(message, 21);
+ Matcher matcher = pattern.matcher(message);
+ if (!matcher.find())
+ throw new RuntimeException("Could not parse migration-error: " + message);
+ oldId = Long.parseLong(matcher.group(1));
+ newId = Long.parseLong(matcher.group(2));
+ }
+
+
+ public Long getOldId()
+ {
+ return oldId;
+ }
+
+ public Long getNewId()
+ {
+ return newId;
+ }
+}