use of com.cdeledu.common.base.AjaxJson in project wechat by dllwh.
the class GlobalExceptionHandler method handleHttpMediaTypeNotSupportedException.
/**
* 415 - Unsupported Media Type
*/
@ResponseBody
@ResponseStatus(HttpStatus.UNSUPPORTED_MEDIA_TYPE)
@ExceptionHandler(HttpMediaTypeNotSupportedException.class)
public AjaxJson handleHttpMediaTypeNotSupportedException(final Exception e) {
AjaxJson result = new AjaxJson();
if (logger.isDebugEnabled()) {
logger.error(HttpStatus.UNSUPPORTED_MEDIA_TYPE.getReasonPhrase(), e);
}
result.setSuccess(false);
result.setMsg(e.getMessage());
result.setResultCode(415);
return result;
}
Aggregations