WIP: 2200: An active access token must be used
authorKai Moritz <kai@jupl.de>
Fri, 22 Nov 2019 07:41:52 +0000 (08:41 +0100)
committerKai Moritz <kai@jupl.de>
Fri, 22 Nov 2019 07:41:52 +0000 (08:41 +0100)
TODO: Rename...
2500: An active access token must be used

src/main/java/de/juplo/facebook/errors/ActiveAccessTokenMissingException.java [new file with mode: 0644]
src/main/java/de/juplo/facebook/errors/GraphApiException.java
src/test/java/de/juplo/facebook/errors/GraphApiExceptionTest.java

diff --git a/src/main/java/de/juplo/facebook/errors/ActiveAccessTokenMissingException.java b/src/main/java/de/juplo/facebook/errors/ActiveAccessTokenMissingException.java
new file mode 100644 (file)
index 0000000..ca7be15
--- /dev/null
@@ -0,0 +1,23 @@
+package de.juplo.facebook.errors;
+
+
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+
+
+
+/**
+ * 2200: Callback verification failed.
+ * @author Kai Moritz
+ */
+public class ActiveAccessTokenMissingException extends OAuthException
+{
+  protected ActiveAccessTokenMissingException(
+      HttpStatus status,
+      HttpHeaders headers,
+      FacebookErrorMessage error
+      )
+  {
+    super(status, headers, error);
+  }
+}
index 3e73807..0cc1961 100644 (file)
@@ -208,6 +208,7 @@ public class GraphApiException extends RuntimeException
       // 1100..1199: live-message errors
       case 1609005: return new LinkPostFailureException(status, headers, error);
       case 2200:  return new CallbackVerificationFailedException(status, headers, error);
+      case 2500:  return new ActiveAccessTokenMissingException(status, headers, error);
 
       default:
         GraphApiException e = new UnmappedErrorException(status, headers, error);
index 9d55e85..a164d89 100644 (file)
@@ -246,7 +246,7 @@ public class GraphApiExceptionTest
   }
 
   @Test
-  public void testError2200()
+  public void testError2500()
   {
     String str ="{\"error\":{\"message\":\"An active access token must be used to query information about the current user.\",\"type\":\"OAuthException\",\"code\":2500,\"fbtrace_id\":\"AUmMHJlVYvTbQrBT11Dk104\"}}";
     byte[] message = str.getBytes();