/**
- *
- * @author kai
+ * 21: Page ID (XXX) was migrated to page ID (YYY).
+ * @author Kai Moritz
*/
public class PageMigratedException extends OAuthException
{
private final Long oldId, newId;
- public PageMigratedException(String message)
+ protected PageMigratedException(FacebookErrorMessage error)
{
- super(message, 21);
- Matcher matcher = pattern.matcher(message);
+ super(error);
+ Matcher matcher = pattern.matcher(error.message);
if (!matcher.find())
- throw new RuntimeException("Could not parse migration-error: " + message);
+ {
+ String warning = "Could not parse migration-error: " + error.message;
+ LOG.error(warning);
+ throw new RuntimeException(warning);
+ }
oldId = Long.parseLong(matcher.group(1));
newId = Long.parseLong(matcher.group(2));
}