X-Git-Url: https://juplo.de/gitweb/?p=facebook-utils;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Fjuplo%2Ffacebook%2Fexceptions%2FGraphApiException.java;h=1055b2091c2013befe7ce3c693131da74224b351;hp=03aa6278dbfe5da76ec07446a0b5ac4c7ff4c3b3;hb=d0accf7044000e7f20e8bd586c3c48ce8c8cef7d;hpb=64f31d5b0dda912b11f9f0078839b95e142ecedd diff --git a/src/main/java/de/juplo/facebook/exceptions/GraphApiException.java b/src/main/java/de/juplo/facebook/exceptions/GraphApiException.java index 03aa627..1055b20 100644 --- a/src/main/java/de/juplo/facebook/exceptions/GraphApiException.java +++ b/src/main/java/de/juplo/facebook/exceptions/GraphApiException.java @@ -1,5 +1,8 @@ package de.juplo.facebook.exceptions; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonRootName; import org.springframework.security.oauth2.common.exceptions.OAuth2Exception; /** @@ -59,4 +62,30 @@ public class GraphApiException extends OAuth2Exception builder.append("}}"); return builder.toString(); } + + + /** + * This class represents an error message from the Graph-API + * + * @see https://developers.facebook.com/docs/graph-api/using-graph-api/v2.5#errors + */ + @JsonRootName("error") + @JsonPropertyOrder({ "message", "type", "code", "error_subcode", "error_user_title", "error_user_msg", "fbtrace_id" }) + public static 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; + } }