X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Fjuplo%2Ffacebook%2Ferrors%2FFacebookErrorMessage.java;h=b11d98db8f84c5022c85d3a5dfa3f903c7e8dac9;hb=2ee955aa31aac3dff18457f032fce4ed15049cd2;hp=495c665b4b220ac9b6c0f7d1d9e7a7717eb208d3;hpb=89065da8bbd59c4973d837c10cf63d967f6357cc;p=facebook-errors diff --git a/src/main/java/de/juplo/facebook/errors/FacebookErrorMessage.java b/src/main/java/de/juplo/facebook/errors/FacebookErrorMessage.java index 495c665..b11d98d 100644 --- a/src/main/java/de/juplo/facebook/errors/FacebookErrorMessage.java +++ b/src/main/java/de/juplo/facebook/errors/FacebookErrorMessage.java @@ -1,6 +1,9 @@ package de.juplo.facebook.errors; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonRootName; @@ -23,20 +26,39 @@ import com.fasterxml.jackson.annotation.JsonRootName; "error_user_msg", "fbtrace_id" }) +@JsonIgnoreProperties(ignoreUnknown = true) public class FacebookErrorMessage { @JsonProperty("message") + @JsonInclude(NON_EMPTY) String message; @JsonProperty("type") + @JsonInclude(NON_EMPTY) String type; @JsonProperty("code") + @JsonInclude(NON_EMPTY) Integer code; @JsonProperty("error_subcode") + @JsonInclude(NON_EMPTY) Integer subCode; @JsonProperty("error_user_title") + @JsonInclude(NON_EMPTY) String userTitle; @JsonProperty("error_user_msg") + @JsonInclude(NON_EMPTY) String userMessage; @JsonProperty("fbtrace_id") + @JsonInclude(NON_EMPTY) String traceId; + @JsonProperty("is_transient") + @JsonInclude(NON_EMPTY) + Boolean isTransient; + + + FacebookErrorMessage() {} + + FacebookErrorMessage(Exception e) + { + message = e.toString(); + } }