--- /dev/null
+package de.juplo.facebook.exceptions;
+
+
+import de.juplo.facebook.exceptions.GraphApiException.FacebookErrorMessage;
+
+
+
+/**
+ * 104: An access token is required to request this resource.
+ * @author Kai Moritz
+ */
+public class AccessTokenRequiredException extends OAuthException
+{
+ protected AccessTokenRequiredException(FacebookErrorMessage error)
+ {
+ super(error);
+ }
+}
case 21: return new PageMigratedException(error);
// 100..199: graph method errors
case 100: return new UnsupportedGetRequestException(error);
+ case 104: return new AccessTokenRequiredException(error);
// 200..299: permission errors
// 300..399: data editing errors
// 400..449: authentication error
package de.juplo.facebook.client;
+import de.juplo.facebook.exceptions.AccessTokenRequiredException;
import de.juplo.facebook.exceptions.UnsupportedGetRequestException;
import de.juplo.facebook.exceptions.UnexpectedErrorException;
import de.juplo.facebook.exceptions.RateExceededException;
}
}
+ @Test
+ public void testError104()
+ {
+ log.info("testError104");
+
+ requestFactory.setBody("{\"error\":{\"message\":\"An access token is required to request this resource.\",\"type\":\"OAuthException\",\"code\":104,\"fbtrace_id\":\"E2Jjkj5++LL\"}}");
+
+ try
+ {
+ clientTemplate.getForObject("ANY", SOME.class);
+ fail("The expected exception was not thrown");
+ }
+ catch(AccessTokenRequiredException e)
+ {
+ log.debug("{}", e.toString());
+ assertEquals("invalid_request", e.getOAuth2ErrorCode());
+ assertEquals(new Integer(104), e.getCode());
+ assertEquals("An access token is required to request this resource.", e.getMessage());
+ assertEquals("OAuthException", e.getType());
+ assertEquals("E2Jjkj5++LL", e.getTraceId());
+ }
+ }
+
@Test
public void testError613()
{