本文整理匯總了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());
}
}