import com.fasterxml.jackson.databind.SerializationFeature;
import java.io.IOException;
import java.io.InputStream;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
/**
*/
public class GraphApiException extends OAuth2Exception
{
+ final static Logger LOG = LoggerFactory.getLogger(GraphApiException.class);
final static ObjectMapper OBJECT_MAPPER;
private final FacebookErrorMessage error;
// 1000..1099: event api errors
// 1100..1199: live-message errors
- default: return new UnmappedErrorException(error);
+ default:
+ LOG.info("unmapped error: {}", error);
+ return new UnmappedErrorException(error);
}
}
}
catch(JsonProcessingException e)
{
- return "Could not convert error in JSON-representation: " + e.getMessage();
+ // This should never happen. But in case of a mistake: be verbose!
+ LOG.error("could not convert message into JSON: {}", e);
+ return e.getMessage();
}
}