Package org.springframework.social

Examples of org.springframework.social.UncategorizedApiException


  private <T> List<T> deserializeDataList(JsonNode jsonNode, final Class<T> elementType) {
    try {
      CollectionType listType = TypeFactory.defaultInstance().constructCollectionType(List.class, elementType);
      return (List<T>) objectMapper.reader(listType).readValue(jsonNode.toString()); // TODO: EXTREMELY HACKY--TEMPORARY UNTIL I FIGURE OUT HOW JACKSON 2 DOES THIS
    } catch (IOException e) {
      throw new UncategorizedApiException("facebook", "Error deserializing data from Facebook: " + e.getMessage(), e);
    }
  }
View Full Code Here


  private void handleUncategorizedError(ClientHttpResponse response, Map<String, String> errorDetails) {
    try {
      super.handleError(response);
    } catch (Exception e) {
      if (errorDetails != null) {
        throw new UncategorizedApiException("facebook", errorDetails.get("message"), e);
      } else {
        throw new UncategorizedApiException("facebook", "No error details from Facebook", e);
      }
    }
  }
View Full Code Here

      // be null when trying to deserialize the type property.
      node.put("postType", postType); // used for polymorphic deserialization
      node.put("type", postType); // used to set Post's type property
      return objectMapper.reader(type).readValue(node.toString()); // TODO: EXTREMELY HACKY--TEMPORARY UNTIL I FIGURE OUT HOW JACKSON 2 DOES THIS
    } catch (IOException shouldntHappen) {
      throw new UncategorizedApiException("facebook", "Error deserializing " + postType + " post", shouldntHappen);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.social.UncategorizedApiException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.