Example usage for org.springframework.web HttpMediaTypeNotAcceptableException getClass

List of usage examples for org.springframework.web HttpMediaTypeNotAcceptableException getClass

Introduction

In this page you can find the example usage for org.springframework.web HttpMediaTypeNotAcceptableException getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:br.com.modoagil.asr.rest.support.RESTErrorHandler.java

/**
 * Manipula exceo para status HTTP {@code 406}
 *
 * @param ex//from  www  . j  a  va  2s  . co  m
 *            {@link HttpMediaTypeNotAcceptableException}
 * @return resposta ao cliente
 */
@ResponseBody
@ExceptionHandler(HttpMediaTypeNotAcceptableException.class)
public Response<E> processHttpMediaTypeNotAcceptableException(final HttpMediaTypeNotAcceptableException ex) {
    this.logger.info("handleHttpMediaTypeNotAcceptableException - Catching: " + ex.getClass().getSimpleName(),
            ex);
    return new ResponseBuilder<E>().success(false).message(ex.getMessage()).status(HttpStatus.NOT_ACCEPTABLE)
            .build();
}