Refactoring: moved FacebookErrorMessage in its own file/class
[facebook-utils] / src / main / java / de / juplo / facebook / exceptions / FacebookErrorMessage.java
diff --git a/src/main/java/de/juplo/facebook/exceptions/FacebookErrorMessage.java b/src/main/java/de/juplo/facebook/exceptions/FacebookErrorMessage.java
new file mode 100644 (file)
index 0000000..a1bd4b3
--- /dev/null
@@ -0,0 +1,42 @@
+package de.juplo.facebook.exceptions;
+
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+
+
+/**
+ * This class represents an error message from the Graph-API
+ *
+ * @see <a href="https://developers.facebook.com/docs/graph-api/using-graph-api/v2.5#errors">Graph-API Documentation</a>
+ * @author Kai Moritz
+ */
+@JsonRootName("error")
+@JsonPropertyOrder({
+  "message",
+  "type",
+  "code",
+  "error_subcode",
+  "error_user_title",
+  "error_user_msg",
+  "fbtrace_id"
+  })
+public class FacebookErrorMessage
+{
+  @JsonProperty("message")
+  String message;
+  @JsonProperty("type")
+  String type;
+  @JsonProperty("code")
+  Integer code;
+  @JsonProperty("error_subcode")
+  Integer subCode;
+  @JsonProperty("error_user_title")
+  String userTitle;
+  @JsonProperty("error_user_msg")
+  String userMessage;
+  @JsonProperty("fbtrace_id")
+  String traceId;
+}