--- /dev/null
+package de.juplo.facebook.errors;
+
+
+
+/**
+ * 10: Authorization declined / not granted
+ * 200-299: Authorization declined / not granted (multiple values, according to authorization)
+ * @author Kai Moritz
+ * @see https://developers.facebook.com/docs/graph-api/using-graph-api/#errors
+ */
+public class AuthorizationMissingException extends OAuthException
+{
+ protected AuthorizationMissingException(FacebookErrorMessage error)
+ {
+ super(error);
+ }
+}
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanCreationException;
+import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.social.FacebookAutoConfiguration;
}
};
}
+
+ @Bean
+ static public BeanDefinitionRegistryPostProcessor test()
+ {
+ return new BeanDefinitionRegistryPostProcessor()
+ {
+ @Override
+ public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException
+ {
+ for(String name : registry.getBeanDefinitionNames())
+ {
+ BeanDefinition bean = registry.getBeanDefinition(name);
+ LOG.info("{}: {} - {} / {}", name, bean.getBeanClassName(), bean.getFactoryBeanName(), bean);
+ }
+ }
+
+ @Override
+ public void postProcessBeanFactory(ConfigurableListableBeanFactory factory) throws BeansException
+ {
+ for(String name : factory.getBeanNamesForType(Facebook.class))
+ {
+ BeanDefinition bean = factory.getBeanDefinition(name);
+ LOG.info("{}{}", name, factory.isFactoryBean(name) ? " (factory)" : "");
+ }
+ }
+ };
+ }
}
\ No newline at end of file
// 1..99: general errors
case 1: return new UnknownErrorException(error);
case 2: return new UnexpectedErrorException(error);
+ case 4: return new TooManyAppCallsException(error);
+ case 10: return new AuthorizationMissingException(error);
+ case 17: return new TooManyUserCallsException(error);
case 21: return new PageMigratedException(error);
// 100..199: graph method errors
case 100: return new UnsupportedGetRequestException(error);
case 102: return new UserAccessTokenRequiredException(error);
case 104: return new AccessTokenRequiredException(error);
// 200..299: permission errors
- // 300..399: data editing errors
+ case 200:
+ case 201:
+ case 202:
+ case 203:
+ case 204:
+ case 205:
+ case 206:
+ case 207:
+ case 208:
+ case 209:
+ case 210:
+ case 211:
+ case 212:
+ case 213:
+ case 214:
+ case 215:
+ case 216:
+ case 217:
+ case 218:
+ case 219:
+ case 220:
+ case 221:
+ case 222:
+ case 223:
+ case 224:
+ case 225:
+ case 226:
+ case 227:
+ case 228:
+ case 229:
+ case 230:
+ case 231:
+ case 232:
+ case 233:
+ case 234:
+ case 235:
+ case 236:
+ case 237:
+ case 238:
+ case 239:
+ case 240:
+ case 241:
+ case 242:
+ case 243:
+ case 244:
+ case 245:
+ case 246:
+ case 247:
+ case 248:
+ case 249:
+ case 250:
+ case 251:
+ case 252:
+ case 253:
+ case 254:
+ case 255:
+ case 256:
+ case 257:
+ case 258:
+ case 259:
+ case 260:
+ case 261:
+ case 262:
+ case 263:
+ case 264:
+ case 265:
+ case 266:
+ case 267:
+ case 268:
+ case 269:
+ case 270:
+ case 271:
+ case 272:
+ case 273:
+ case 274:
+ case 275:
+ case 276:
+ case 277:
+ case 278:
+ case 279:
+ case 280:
+ case 281:
+ case 282:
+ case 283:
+ case 284:
+ case 285:
+ case 286:
+ case 287:
+ case 288:
+ case 289:
+ case 290:
+ case 291:
+ case 292:
+ case 293:
+ case 294:
+ case 295:
+ case 296:
+ case 297:
+ case 298:
+ case 299: return new AuthorizationMissingException(error);
+ // 200..299: permission errors
+ // 300..399: data editing errors ?
+ case 341: return new TemporaryRateLimitExceededException(error);
// 400..449: authentication error
// 450..499: session errors
- // 500..599: application messaging errors
+ // 500..599: application messaging errors ?
+ case 506: return new MultipleConcurrentPostsException(error);
// 600..699: FQL errors
- case 613: return new RateExceededException(error);
+ case 613: return new RateLimitExceededException(error);
// 700..749: ref errors
// 750..799: application integration errors
// 900..949: application information errors
// 950..999: batch api errors
// 1000..1099: event api errors
// 1100..1199: live-message errors
+ case 1609005: return new LinkPostFailureException(error);
case 2200: return new CallbackVerificationFailedException(error);
default:
--- /dev/null
+package de.juplo.facebook.errors;
+
+
+
+/**
+ * 1609005: Failure while posting link (data could not be read from link)
+ * @author Kai Moritz
+ * @see https://developers.facebook.com/docs/graph-api/using-graph-api/#errors
+ */
+public class LinkPostFailureException extends OAuthException
+{
+ protected LinkPostFailureException(FacebookErrorMessage error)
+ {
+ super(error);
+ }
+}
--- /dev/null
+package de.juplo.facebook.errors;
+
+
+
+/**
+ * 506: Multiple concurrent posts
+ * @author Kai Moritz
+ * @see https://developers.facebook.com/docs/graph-api/using-graph-api/#errors
+ */
+public class MultipleConcurrentPostsException extends OAuthException
+{
+ protected MultipleConcurrentPostsException(FacebookErrorMessage error)
+ {
+ super(error);
+ }
+}
+++ /dev/null
-package de.juplo.facebook.errors;
-
-
-
-/**
- * 613: Calls to stream have exceeded the rate of 600 calls per 600 seconds.
- * @author Kai Moritz
- */
-public class RateExceededException extends OAuthException
-{
- protected RateExceededException(FacebookErrorMessage error)
- {
- super(error);
- }
-}
--- /dev/null
+package de.juplo.facebook.errors;
+
+
+
+/**
+ * 613: Calls to stream have exceeded the rate of 600 calls per 600 seconds.
+ * @author Kai Moritz
+ */
+public class RateLimitExceededException extends OAuthException
+{
+ protected RateLimitExceededException(FacebookErrorMessage error)
+ {
+ super(error);
+ }
+}
--- /dev/null
+package de.juplo.facebook.errors;
+
+
+
+/**
+ * 341: Temporary rate-limit excession because of server-failure or throtteling
+ * @author Kai Moritz
+ * @see https://developers.facebook.com/docs/graph-api/using-graph-api/#errors
+ */
+public class TemporaryRateLimitExceededException extends OAuthException
+{
+ protected TemporaryRateLimitExceededException(FacebookErrorMessage error)
+ {
+ super(error);
+ }
+}
--- /dev/null
+package de.juplo.facebook.errors;
+
+
+
+/**
+ * 4: To many API-calls
+ * @author Kai Moritz
+ * @see https://developers.facebook.com/docs/graph-api/using-graph-api/#errors
+ */
+public class TooManyAppCallsException extends OAuthException
+{
+ protected TooManyAppCallsException(FacebookErrorMessage error)
+ {
+ super(error);
+ }
+}
--- /dev/null
+package de.juplo.facebook.errors;
+
+
+
+/**
+ * 17: To many API-usercalls
+ * @author Kai Moritz
+ * @see https://developers.facebook.com/docs/graph-api/using-graph-api/#errors
+ */
+public class TooManyUserCallsException extends OAuthException
+{
+ protected TooManyUserCallsException(FacebookErrorMessage error)
+ {
+ super(error);
+ }
+}
clientTemplate.getForObject("ANY", SOME.class);
fail("The expected exception was not thrown");
}
- catch(RateExceededException e)
+ catch(RateLimitExceededException e)
{
log.debug("{}", e.toString());
assertEquals(new Integer(613), e.getCode());