本文整理汇总了Java中com.fasterxml.jackson.core.JsonProcessingException.getOriginalMessage方法的典型用法代码示例。如果您正苦于以下问题:Java JsonProcessingException.getOriginalMessage方法的具体用法?Java JsonProcessingException.getOriginalMessage怎么用?Java JsonProcessingException.getOriginalMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.fasterxml.jackson.core.JsonProcessingException
的用法示例。
在下文中一共展示了JsonProcessingException.getOriginalMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleHttpMessageNotReadableException
import com.fasterxml.jackson.core.JsonProcessingException; //导入方法依赖的package包/类
@ExceptionHandler(HttpMessageNotReadableException.class)
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
@ResponseBody
public XAPIErrorInfo handleHttpMessageNotReadableException(final HttpServletRequest request, HttpMessageNotReadableException e) {
if (e.getCause() instanceof UnrecognizedPropertyException) {
return this.handleUnrecognizedPropertyException(request, (UnrecognizedPropertyException)e.getCause());
} else {
XAPIErrorInfo result;
if (e.getCause() instanceof JsonProcessingException) {
final JsonProcessingException jpe = (JsonProcessingException)e.getCause();
result = new XAPIErrorInfo(HttpStatus.BAD_REQUEST, request, jpe.getOriginalMessage());
} else {
result = new XAPIErrorInfo(HttpStatus.BAD_REQUEST, request, e);
}
this.logException(e);
this.logError(result);
return result;
}
}
开发者ID:Apereo-Learning-Analytics-Initiative,项目名称:OpenLRW,代码行数:20,代码来源:XAPIExceptionHandlerAdvice.java
示例2: readPropertyBox
import com.fasterxml.jackson.core.JsonProcessingException; //导入方法依赖的package包/类
/**
* Read a {@link PropertyBox} from JSON content, using current {@link com.holonplatform.core.Context} property set.
* @param reader Reader
* @return The deserialized {@link PropertyBox} instance
* @throws IOException IO read error
* @throws WebApplicationException JSON processing exception
*/
private PropertyBox readPropertyBox(Reader reader) throws IOException {
try {
return getObjectReader().readValue(reader);
} catch (JsonProcessingException e) {
throw new WebApplicationException(e.getOriginalMessage(), Response.status(Status.BAD_REQUEST)
.type(MediaType.TEXT_PLAIN).entity(e.getOriginalMessage()).build());
}
}