--- /dev/null
+package de.juplo.facebook.errors;
+
+
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+
+
+
+
+/**
+ * 190: Bad signature (access token expired!).
+ * As of Octobre 2019 the {@link https://developers.facebook.com/docs/graph-api/using-graph-api/error-handling/ Documentation }
+ * says "Access token has expired. Get a new access token." for code 190.
+ * @author Kai Moritz
+ */
+public class AccessTokenExpiredException extends OAuthException
+{
+ protected AccessTokenExpiredException(
+ HttpStatus status,
+ HttpHeaders headers,
+ FacebookErrorMessage error
+ )
+ {
+ super(status, headers, error);
+ }
+}
case 100: return new UnsupportedGetRequestException(status, headers, error);
case 102: return new UserAccessTokenRequiredException(status, headers, error);
case 104: return new AccessTokenRequiredException(status, headers, error);
+ case 190: return new AccessTokenExpiredException(status, headers, error);
// 200..299: permission errors
case 200:
case 201:
}
}
+ @Test
+ public void testError190()
+ {
+ log.info("testError190");
+
+ requestFactory.setBody("{\"error\":{\"message\":\"Bad signature\",\"type\":\"OAuthException\",\"code\":190,\"fbtrace_id\":\"Ay2OYQrINbXOCfQpBvoxDIw\"}}");
+
+ try
+ {
+ clientTemplate.getForObject("ANY", SOME.class);
+ fail("The expected exception was not thrown");
+ }
+ catch(AccessTokenExpiredException e)
+ {
+ log.debug("{}", e.toString());
+ assertEquals(new Integer(190), e.getCode());
+ assertEquals("Bad signature", e.getMessage());
+ assertEquals(Type.OAuthException, e.getType());
+ assertEquals("Ay2OYQrINbXOCfQpBvoxDIw", e.getTraceId());
+ }
+ }
+
@Test
public void testError613()
{